node-dextrin - v0.4.0
    Preparing search index...

    Class export=

    The result of compiling one %schema(N){} entry from a .dxns document (schema/compiler.cjs) — enough to both validate a decoded value and convert it both directions between .dxnb's always-positional wire shape and a named field map. Mirrors Dextrin.Schema.Compiled.

    fields is ordered — that order is the canonical position <-> name mapping .dxnb's positional struct encoding needs, and it is the order the fields are written in the %schema(N){...} body.

    version is which version of name this is (DXN.md §4.8), 1 for a schema written without a header.

    Index
    • Parameters

      • spec: {
            annotations?: { [k: string]: unknown };
            bases?: Base[];
            fields?: export=[];
            name?: string | null;
            version?: number;
        } = {}

      Returns export=

    annotations: { [k: string]: unknown }

    What a {:doc %schema{...} %{...}} around the entry says about it (DXNS.md §1b), by name; empty when it says nothing.

    bases: Base[]

    What it was built from (DXNS.md §4b), as [kind, name, version]: each schema at the version it was built with, a shape with null. What an extends makes it acceptable as; empty for a schema written whole.

    fields: export=[]
    name: string | null
    version: number
    • instance -- a registered application class instance -- as the keyed struct it is written as (DXNS.md §3, §4.7). A field it does not have, or holds as undefined, is absent, never null: a reader refuses null unless the type admits it. An own property the schema does not declare is an extra field, written back with the struct, as an Elixir struct's undeclared keys are.

      Parameters

      • instance: object

      Returns DXNStruct