Skip to content

Function: canonicalize()

ts
function canonicalize(obj): string;

Defined in: packages/core/src/introspection/canonicalize.ts:66

Canonical JSON serialization with deterministic key ordering.

Guarantees that two structurally identical objects produce the same string regardless of property insertion order. This is critical for content-addressed hashing — the same contract must always produce the same digest.

Parameters

ParameterTypeDescription
objunknownThe value to serialize

Returns

string

Deterministic JSON string