Defines the JSON encoding of a POD value. Unlike the PODValue type,
values which fit this type contain only JSON-compatible types (no bigints).
They can thus be freely combined with other JSON and serialized using
JSON.stringify.
For each PODValue type, there can be up to 3 possible encoding formats,
which are intended to allow terse and human-readable.
A bare JSON type, such as number for int, and string for string
A terse JSON object with the PODValue type as its only key, like
{ "int": 123 }
An explicit JSON object with 2 keys, like { "type": "int", "value": 123 }
Use podValueToJSON and podValueFromJSON to convert between
JSON and non-JSON formats. When parsing, any of the encodings above will
be produced. When producing JSON, the smallest encoding will be used.
See the individual subtypes for more information on specific encoding
requirements and assumptions.
Defines the JSON encoding of a POD value. Unlike the PODValue type, values which fit this type contain only JSON-compatible types (no bigints). They can thus be freely combined with other JSON and serialized using JSON.stringify.
For each PODValue type, there can be up to 3 possible encoding formats, which are intended to allow terse and human-readable.
number
for int, andstring
for string{ "int": 123 }
{ "type": "int", "value": 123 }
Use podValueToJSON and podValueFromJSON to convert between JSON and non-JSON formats. When parsing, any of the encodings above will be produced. When producing JSON, the smallest encoding will be used.
See the individual subtypes for more information on specific encoding requirements and assumptions.