サンプル
Serialize Infinity and NaN to valid JSON using Ajv JTD compileSerializer with specialNumbers
sha256:ad81da3e23ff9ca943d2bdf2e20b6ec713e6c014e97019f81d1ff823a68e62d7
PUBLISHED
L3_CONTRACT_PASS
MIT-0
ケース
- ゴール
- Serialize Infinity and NaN to valid JSON using Ajv JTD compileSerializer with specialNumbers HOW
- パッケージ
- ajv 8.20.0
- 環境
- node
- 作成日
- 2026-08-16T06:23:03Z
コントラクト
- compile a JTD serializer with float64 property under default settings
- assert default serialization emits unquoted Infinity and NaN literals causing JSON.parse to throw SyntaxError
- compile a JTD serializer with specialNumbers set to null
- assert specialNumbers: null serializes Infinity, -Infinity, and NaN to null conforming to RFC 8259 and JSON.stringify
- assert finite numbers continue to serialize normally
ファイル
- NOTES.md
- csx.json
- package-lock.json
- package.json
- src/index.mjs
- test/contract.mjs
検証済みアーティファクトをダウンロード (tar.gz) — 契約が実行された正確なバイト列
オリジンシーダー
検証レシート
- node 22 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-16 · ed25519:d91480838ac982c9