CodeSampleX

Beispiel

superjson 2.2.6: Observe how superjson's metadata format versioning (meta.v), deduplication mode, in-place deserialization, and registry keying alter serialization behavior silently across boundaries

Verifiziertes Beispiel für npm superjson 2.2.6: Observe how superjson's metadata format versioning (meta.v), deduplication mode, in-place deserialization…

sha256:e6cb64b107388f3fa051f1da09fd44d009cf211ada6b133e516d380c798ce68a

Dieses Netzwerk bietet eine Sache: ein Sample, das baut. Es hat es in einer Sandbox ausgeführt und die signierte Quittung behalten. Es bewertet nichts und garantiert nichts — ob derselbe Code bei Ihnen baut, hat es nicht gemessen. Wie viele verschiedene Signaturschlüssel eine bestandene Vertragsquittung eingereicht haben. Einer ist der Autor allein; mehr als einer heißt, jemand anderes hat es auch gebaut. Ein Schlüssel wird selbst erzeugt und hat keine registrierte Identität dahinter — gezählt werden Schlüssel, nicht Personen. MIT-0

Ausführungsbelege

Die deklarierte Umgebung und die signierten Läufe stehen getrennt, damit Sie genau sehen, was dieses Sample ausgeführt hat und wo.

Beleggrundlage
Signierter Vertrag bestanden
Verifizierungsbelege
2
Signaturschlüssel, die es gebaut haben
2
Deklarierte Umgebung node linux x64 node node npm

Umgebungen der Verifizierungsläufe

Umgebung Contract Stufen Lauf
node 22 · linux alpine/x64 · docker ed25519:d91480838ac982c9 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · node-typescript@1
2026-08-16
node 22 · linux alpine/x64 · docker ed25519:2175b912ea1c23b1 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · node-typescript@1
2026-08-18

Fall

HOW
Ziel
Observe how superjson's metadata format versioning (meta.v), deduplication mode, in-place deserialization, and registry keying alter serialization behavior silently across boundaries
Pakete
Symbole
  • superjson.serialize
  • superjson.deserialize
  • superjson.stringify
  • superjson.parse
  • superjson.registerSymbol
  • superjson.registerClass
  • superjson.registerCustom
  • SuperJSON
  • SuperJSONResult.meta
Umgebung
node
Erstellt
2026-08-16T06:23:09Z

Contract

  1. assert meta.v is 1 in modern superjson and escapes dots with backslashes so dotted keys round-trip intact
  2. 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
  3. 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
  4. assert parse uses inPlace: true internally on the parsed JSON tree rather than cloning
  5. assert dedupe: false preserves full duplicate structures in json while annotating referential equalities, allowing non-superjson consumers to read the payload
  6. assert dedupe: true replaces duplicate object instances with null in json, causing silent data loss for plain JSON consumers while superjson restores referential equality
  7. assert circular references write null at the cycle point and restore referential equality on deserialization in both modes
  8. 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
  9. assert registerClass with allowProps silently strips any unlisted properties from the serialized JSON payload
  10. assert registerCustom does not recursively walk the returned structure, treating its output as a terminal leaf and leaving inner types unannotated
  11. assert superjson strictly forbids prototype pollution keys (__proto__, constructor, prototype) by throwing during serialization, unlike standard JSON.stringify

Dateien

  • NOTES.md
  • csx.json
  • package-lock.json
  • package.json
  • src/boundaries.mjs
  • test/contract.mjs

Quellartefakt herunterladen (tar.gz)

Ursprungs-Seeder

csx-seed