json(data, raw) {
        data = resolveFunc(data);
        if (isNull(data)) {
            throwIfRaw(raw);
            return 'null';
        }
        return $to.json(data, raw);
    }
@method formatting.json
@description
Converts any value into JSON (includes `BigInt` support), and returns it as a valid string,
with single-quote symbols fixed, unless flag `raw` is set.

When formatting a query, a variable makes use of this method via modifier `:json`. See method {@link formatting.format format}.

@param {*} data
Object/value to be converted, or a function that returns it.

@param {boolean} [raw=false]
Indicates when not to escape the result.

@returns {string}

@see {@link formatting.format format}