Decodes .dxn text into a value — every DXN type maps to a native
JS value or a DXN* wrapper class, see src/values/index.cjs's
DXNValue typedef for the full mapping. Throws DXNError on
malformed input, including a schema violation for any registered
struct name the text uses.
Safe by default: keyword decodes as DXNKeyword, so no input
can fill the global symbol registry. Pass trusted: true (or a
registry with putTrusted(true)) for a source you control -- your own
config, your own application's data -- and it decodes as a real, global
Symbol.for(name), the closest native analog to a BEAM atom and, like
one, never garbage collected. symbol is unaffected either way.
registry: (a Registry built via schema.compile) enables
schema-backed struct decoding and custom-tag decoding for any
name it knows — a struct/tag with no matching registry entry
falls back to an opaque DXNStruct/DXNCustomTag, never a hard
failure.
Decodes
.dxntext into a value — every DXN type maps to a native JS value or aDXN*wrapper class, seesrc/values/index.cjs'sDXNValuetypedef for the full mapping. ThrowsDXNErroron malformed input, including a schema violation for any registeredstructname the text uses.Safe by default:
keyworddecodes asDXNKeyword, so no input can fill the global symbol registry. Passtrusted: true(or a registry withputTrusted(true)) for a source you control -- your own config, your own application's data -- and it decodes as a real, globalSymbol.for(name), the closest native analog to a BEAM atom and, like one, never garbage collected.symbolis unaffected either way.registry:(aRegistrybuilt viaschema.compile) enables schema-backedstructdecoding and custom-tag decoding for any name it knows — astruct/tag with no matching registry entry falls back to an opaqueDXNStruct/DXNCustomTag, never a hard failure.