• Recursively revive a JSON-decoded value into live runtime objects — the inverse of defaultToJSON.

    Parameters

    • value: unknown

      The parsed JSON value to revive.

    • Optionalctx: { parent?: unknown }

      Reconstruction context.

      • Optionalparent?: unknown

        The owning logic for any revived registered instances.

    Returns unknown

    The revived value.

    Handles the encoding tags produced by defaultToJSON: __bigint__:, __date__:, and __url__: string prefixes, and __type-tagged objects for SohlMap/Map/Set/RegExp/Error/URL/ClientDocument.

    Executable code is never revived: there is no new Function path, and no function-reference path. Behavior is not serialized — it travels as data plus a __kind tag and is re-derived on the receiving client, so untrusted data cannot introduce code. Objects carrying a registered-kind marker (KIND_KEY) are reconstructed to their concrete class via getCtorForKind, with children revived bottom-up and the owning logic supplied through ctx.parent.

    Error when reviving a ClientDocument reference if no UUID resolver has been registered (via setUuidResolver — the FoundryHelpers shim registers one at load, so this indicates the shim was not initialized).