Json import type {Json} from '@fuzdev/fuz_util/json.js'; 8 declarations
Json import type {Json} from '@fuzdev/fuz_util/json.js'; <T>(data: T, stringify?: (data: T) => string): string import {json_embed} from '@fuzdev/fuz_util/json.js'; Embeds data as a JSON string, escaping single quotes.
Useful for optimizing JSON in JS because it parses faster.
dataTstringify(data: T) => stringJSON.stringifystring json_embed<T>T(value: unknown): string import {json_stringify_deterministic} from '@fuzdev/fuz_util/json.js'; Serializes a value to JSON with deterministic key ordering. Recursively sorts object keys alphabetically for consistent hashing.
valueunknownstring deterministic JSON string representation
(value: Json): JsonType | undefined import {json_type_of} from '@fuzdev/fuz_util/json.js'; Returns the JsonType of value, which is like typeof json
but includes 'array' and omits 'undefined'.
valueJsonType | undefined JsonArray import type {JsonArray} from '@fuzdev/fuz_util/json.js'; Array<Json>JsonObject import type {JsonObject} from '@fuzdev/fuz_util/json.js'; Record<string, Json>JsonPrimitive import type {JsonPrimitive} from '@fuzdev/fuz_util/json.js'; JsonType import type {JsonType} from '@fuzdev/fuz_util/json.js'; Like typeof json, but includes arrays. Excludes 'undefined' because it's not valid JSON.