Skip to content

Function: canonicalJson()

canonicalJson(value): string

Defined in: packages/core/src/canonical-json.ts:10

Deterministic JSON serialisation: object keys sorted, no whitespace, undefined properties dropped. Used for hashes and server job keys so the same logical value always yields the same string on every runtime.

Throws on values JSON cannot represent (functions, symbols, bigint, cycles) and on non-finite numbers, which JSON.stringify would silently turn into null.

Parameters

value

unknown

Returns

string