The canonical JSON value type — anything JSON.parse can return and
anything JSON.stringify can accept as input. Used by toEnvelope /
fromEnvelope to express the contract precisely: the envelope is a
structured JSON shape, not opaque unknown. Lets consumers wiring this
API into another structured serializer (SuperJSON, DBOS custom
transformers) slot it in without a cast at the boundary.
Added in 1.2.2 — toEnvelope/fromEnvelope previously typed input/output
as unknown, which forced a cast at the consumer side.
The canonical JSON value type — anything
JSON.parsecan return and anythingJSON.stringifycan accept as input. Used bytoEnvelope/fromEnvelopeto express the contract precisely: the envelope is a structured JSON shape, not opaqueunknown. Lets consumers wiring this API into another structured serializer (SuperJSON, DBOS custom transformers) slot it in without a cast at the boundary.Added in 1.2.2 —
toEnvelope/fromEnvelopepreviously typed input/output asunknown, which forced a cast at the consumer side.