Ejemplo
Observe how superjson's metadata format versioning (meta.v), deduplication mode, in-place deserialization, and registry keying alter serialization behavior silently across boundaries
sha256:e6cb64b107388f3fa051f1da09fd44d009cf211ada6b133e516d380c798ce68a
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Caso
- Objetivo
- Observe how superjson's metadata format versioning (meta.v), deduplication mode, in-place deserialization, and registry keying alter serialization behavior silently across boundaries HOW
- Paquetes
- superjson 2.2.6
- Entorno
- node
- Creado
- 2026-08-16T06:23:09Z
Contrato
- assert meta.v is 1 in modern superjson and escapes dots with backslashes so dotted keys round-trip intact
- assert unversioned or legacy meta.v < 1 payloads silently misroute dotted paths to nested sibling properties, leaving the top-level key as a string and creating an Invalid Date without throwing
- assert deserialize defaults to inPlace: false via a deep clone leaving the input payload untouched, whereas inPlace: true directly mutates payload.json into live runtime objects
- assert parse uses inPlace: true internally on the parsed JSON tree rather than cloning
- assert dedupe: false preserves full duplicate structures in json while annotating referential equalities, allowing non-superjson consumers to read the payload
- assert dedupe: true replaces duplicate object instances with null in json, causing silent data loss for plain JSON consumers while superjson restores referential equality
- assert circular references write null at the cycle point and restore referential equality on deserialization in both modes
- assert registerSymbol without an explicit identifier keys by description, so registering two distinct symbols with identical descriptions silently causes the second to overwrite the first upon deserialization
- assert registerClass with allowProps silently strips any unlisted properties from the serialized JSON payload
- assert registerCustom does not recursively walk the returned structure, treating its output as a terminal leaf and leaving inner types unannotated
- assert superjson strictly forbids prototype pollution keys (__proto__, constructor, prototype) by throwing during serialization, unlike standard JSON.stringify
Archivos
- NOTES.md
- csx.json
- package-lock.json
- package.json
- src/boundaries.mjs
- test/contract.mjs
Descargar el artefacto verificado (tar.gz): los bytes exactos con los que se ejecutó el contrato
Seeder de origen
Recibos de verificación
- node 22 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-16 · ed25519:d91480838ac982c9