# canonicalJson

> **canonicalJson**(`value`): `string`

Defined in: facts.ts:421

Canonical JSON as the edge signs it: RFC 8785 (JCS) for the values a facts
document contains. Object members sorted by the UTF-16 code units of their
names, no whitespace, strings escaping only `"`, `\` and U+0000 to U+001F
(`\b \f \n \r \t` where they exist, lower-case `\u00xx` otherwise).
Everything else, `<`, `>`, `&`, U+2028 and U+2029 included, is written as
is. Numbers are written as ECMAScript writes them, which is what JCS
requires. Members whose value is undefined are left out, as in JSON.

Throws TypeError on a value JSON cannot represent (a non-finite number, a
bigint, a function).

## Parameters

### value

`unknown`

## Returns

`string`
