Documentation
    Preparing search index...

    Function validateSceneDocument

    • Validates an arbitrary value as a §79 scene document and returns it in canonical form.

      The result is a fresh, deep-frozen document holding only the fields this format defines, in a fixed key order, with every default omitted — so re-encoding it is byte-stable and no unknown field from an untrusted document survives into the instantiator.

      Parameters

      • value: unknown

        the candidate document (typically JSON.parse output)

      Returns SceneDocument

      the canonical, frozen document

      FourError SERIALIZATION_VERSION_MISMATCH if formatVersion is not SCENE_FORMAT_VERSION — run the value through runSceneMigrations (§80) first

      TypeError if any field is missing, mistyped, or out of range; the message names the field's path