Total order over DXN values. Cross-kind comparisons fall back to
KIND_RANK (this library's own implementation-defined choice, see
module doc); same-kind comparisons use each kind's natural order.
Structural equality between two DXN values, recursing into every
collection/wrapper shape. Two NaN floats are equal (DXN treats
NaN as one specific scalar value, not "incomparable" the way IEEE
754 === does).
Identifies the DXN "kind" of a value for cross-type ranking and
same-kind dispatch. Native JS shapes are recognized directly;
DXN* wrapper instances are recognized via their shared dxnType
prototype tag.
Barrel module for the DXN value model — every wrapper
class plus the shared equality/ordering kernel, and the closed
DXNValue type union documenting every shape a decoded DXN value
can take. Mirrors Dextrin.Value's own moduledoc structure: one JS
shape per DXN type, preferring a native value and falling back to a
DXN* wrapper only where nothing native fits without losing
information (see each class's own JSDoc for why).
Two shapes are worth calling out here, the same way Dextrin.Value
calls out its own non-obvious ones:
integer is always BigInt, never number — the one place
fidelity to Elixir's arbitrary-precision guarantee requires
not picking the closest-looking native type.float is a plain number, including NaN/Infinity/
-Infinity — unlike Elixir, which needs atoms for those three
because the BEAM can't construct a non-finite float term. JS
number natively holds all of IEEE-754, so no wrapper is
needed here at all; this is a case where JS's native type is a
better fit than Elixir's own.Map/Set are typed <unknown, unknown>/<unknown> rather than
<DXNValue, DXNValue>/<DXNValue> — TS's JSDoc @typedef
circularity checker tolerates self-reference through a plain
array/union position (DXNValue[], below) but not through a
generic type argument; this is a checker limitation, not a real
type-precision loss anyone should try to "fix" back.
A stable string encoding of a DXN value, equal for and only for
dxnEquals-equal values. Used internally for structural dedup/sort (e.g.DXNSortedSet's uniqueness invariant) and as a deterministic tiebreaker for kinds with no natural element order (map/set).