The structural shape a Temporal.* value presents to the encode side
of the tagged-container bridge.
Remarks
Encoding needs no Temporal implementation at all — the two members
below are intrinsic to the value (tagged-types.ts:43-47), so the
shape is declared structurally here instead of type-depending on a
polyfill this package does not install.
The tag is the template literal rather than a bare string on
purpose. BigInt.prototype[Symbol.toStringTag] is "BigInt" and
Symbol.prototype[Symbol.toStringTag] is string, so a bare string
here would quietly admit two of the four scalar classes
WireValue exists to place OUTSIDE the wire domain, and the
type would stop describing the codec.
The structural shape a
Temporal.*value presents to the encode side of the tagged-container bridge.Remarks
Encoding needs no
Temporalimplementation at all — the two members below are intrinsic to the value (tagged-types.ts:43-47), so the shape is declared structurally here instead of type-depending on a polyfill this package does not install.The tag is the template literal rather than a bare
stringon purpose.BigInt.prototype[Symbol.toStringTag]is"BigInt"andSymbol.prototype[Symbol.toStringTag]isstring, so a barestringhere would quietly admit two of the four scalar classes WireValue exists to place OUTSIDE the wire domain, and the type would stop describing the codec.