@opscogs/octools
    Preparing search index...

    Function readEnvelope

    • Parse an envelope another process produced, tolerating newer additions.

      model is TabularEnvelope, ArtifactEnvelope or a schema RecordsEnvelope returned; any other schema is a TypeError. data is the decoded object, or JSON text as a string or UTF-8 bytes (malformed text raises SyntaxError). Unknown keys are dropped at the envelope level and in nested artifact references, but not inside records, whose item schema decides for itself. An unknown value in a vocabulary reads as its VOCABULARY_FALLBACKS entry, and a scale on a column that is not numeric reads as null. Every other check still runs and raises ZodError.

      Bytes are decoded as UTF-8, the JSON wire encoding; Python's reader also detects UTF-16 and UTF-32.

      Type Parameters

      • O

      Parameters

      • model: ZodType<O>
      • data: unknown

      Returns O