Skip to main content

Interface: EncodeContext

Context passed to ValueSerializer.is and ValueSerializer.encode.

Properties​

root​

readonly root: object;

Root of the tree the value is encoded against.

Methods​

encode()​

encode(value, key?): JsonValue;

Encodes a nested value with the same serializer.

Parameters​

ParameterTypeDescription
valueunknownValue to encode.
key?PathElementWhere the value is inside its parent, for error paths.

Returns​

JsonValue

The encoded value.