AutoMovie API
    Preparing search index...

    Function encodeAutoMovieArtifactJson

    • Encode a plain data value as artifact bytes that decodeAutoMovieArtifactJson restores exactly.

      JSON alone loses -0, NaN and the infinities and silently flattens typed arrays, maps and class instances, any of which would make a cached result differ from a computed one. This encoder writes the four special numbers as {"$number": "-0" | "NaN" | "Infinity" | "-Infinity"} and refuses every value that is not null, a boolean, a string, a finite number, an array or a plain object (prototype Object.prototype or null), and any plain object owning a $number member, so whatever it accepts decodes to a deeply equal value. Object member order is kept; undefined members are omitted as JSON omits them, and an undefined array element refuses. Shared references are written once per occurrence, so identity between branches is not preserved.

      Parameters

      • value: unknown

        Plain data to encode.

      Returns Uint8Array

      UTF-8 JSON bytes.