Inverse of toEnvelope: reconstruct any value from a parsed JSON envelope
(object/array/primitive). Equivalent to deserialize(JSON.stringify(envelope))
but skips the stringify/parse roundtrip — the same revive walker is
applied directly. Returns Try for the same reasons as deserialize.
Pass-through policy matches deserialize: a parsed value without an
@functype marker is returned verbatim as Success(value).
Input is unknown (intentionally permissive — Postel's law). Host
serializers typically hand the deserialize callback a JSON-shaped value
that they parsed themselves, but their callback typing varies (some are
JSONValue, some are unknown, some are any). Accepting unknown
here means the function slots into any host shape without forcing a
cast at the consumer site.
Inverse of
toEnvelope: reconstruct any value from a parsed JSON envelope (object/array/primitive). Equivalent todeserialize(JSON.stringify(envelope))but skips the stringify/parse roundtrip — the samerevivewalker is applied directly. ReturnsTryfor the same reasons asdeserialize.Pass-through policy matches
deserialize: a parsed value without an@functypemarker is returned verbatim asSuccess(value).Input is
unknown(intentionally permissive — Postel's law). Host serializers typically hand the deserialize callback a JSON-shaped value that they parsed themselves, but their callback typing varies (some areJSONValue, some areunknown, some areany). Acceptingunknownhere means the function slots into any host shape without forcing a cast at the consumer site.