JsonValuetypetype JsonValue = null | boolean | number | string | readonly JsonValue[] | { readonly [key: string]: JsonValue };A value of JSON.
Data, the only thing a requirement may ask for: a value of JSON, with a canonical text in which the keys are in a fixed order, so that two values that are equal are the same text.
import { canonicalJson } from "./json.ts";
canonicalJson({ b: 1, a: [true, null] }); // '{"a":[true,null],"b":1}'JsonValuetypetype JsonValue = null | boolean | number | string | readonly JsonValue[] | { readonly [key: string]: JsonValue };A value of JSON.
isJsonfunctionno test imports itfunction isJson(value: unknown): value is JsonValueWhether an unknown value is data: null, a boolean, a finite number, a string, a list of data or a plain object of data.
canonicalJsonfunctionfunction canonicalJson(value: JsonValue): stringThe text of a value with the keys of every object in order, no space, and nothing that depends on the order they were made in.
sameJsonfunctionno test imports itfunction sameJson(a: JsonValue, b: JsonValue): booleanWhether two values are the same data, whatever the order of the keys.