SysProM
    Preparing search index...

    Function canonicalise

    • Serialise a value to canonical JSON with RFC 8785 key ordering.

      Parameters

      • value: unknown

        The value to serialise.

      • options: FormatOptions = {}

        Formatting options (e.g. indentation).

      Returns string

      The canonical JSON string.

      canonicalise({ b: 1, a: 2 }) // => '{"a":2,"b":1}'
      canonicalise({ b: 1 }, { indent: "\t" }) // => '{\n\t"b": 1\n}'