@toon-format/spec 1.3.2 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/README.md +3 -2
- package/SPEC.md +252 -100
- package/VERSIONING.md +0 -13
- package/package.json +1 -1
- package/tests/README.md +27 -23
- package/tests/fixtures/decode/arrays-nested.json +40 -21
- package/tests/fixtures/decode/arrays-primitive.json +14 -14
- package/tests/fixtures/decode/arrays-tabular.json +28 -5
- package/tests/fixtures/decode/blank-lines.json +14 -14
- package/tests/fixtures/decode/delimiters.json +46 -29
- package/tests/fixtures/decode/indentation-errors.json +16 -50
- package/tests/fixtures/decode/numbers.json +142 -0
- package/tests/fixtures/decode/objects.json +29 -29
- package/tests/fixtures/decode/primitives.json +44 -75
- package/tests/fixtures/decode/root-form.json +17 -0
- package/tests/fixtures/decode/validation-errors.json +29 -9
- package/tests/fixtures/decode/whitespace.json +61 -0
- package/tests/fixtures/encode/arrays-nested.json +15 -15
- package/tests/fixtures/encode/arrays-objects.json +16 -16
- package/tests/fixtures/encode/arrays-primitive.json +14 -14
- package/tests/fixtures/encode/arrays-tabular.json +8 -8
- package/tests/fixtures/encode/delimiters.json +23 -23
- package/tests/fixtures/encode/objects.json +27 -27
- package/tests/fixtures/encode/options.json +1 -1
- package/tests/fixtures/encode/primitives.json +61 -36
- package/tests/fixtures/encode/whitespace.json +18 -3
- package/tests/fixtures.schema.json +3 -4
- package/tests/fixtures/encode/normalization.json +0 -107
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": "1.3",
|
|
3
|
-
"category": "encode",
|
|
4
|
-
"description": "Non-JSON type normalization - BigInt, Date, undefined, NaN, Infinity, functions, symbols",
|
|
5
|
-
"tests": [
|
|
6
|
-
{
|
|
7
|
-
"name": "converts BigInt to number",
|
|
8
|
-
"input": 123,
|
|
9
|
-
"expected": "123",
|
|
10
|
-
"specSection": "5",
|
|
11
|
-
"note": "BigInt(123) in JavaScript becomes 123"
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
"name": "converts BigInt in object to number",
|
|
15
|
-
"input": {
|
|
16
|
-
"id": 456
|
|
17
|
-
},
|
|
18
|
-
"expected": "id: 456",
|
|
19
|
-
"specSection": "5",
|
|
20
|
-
"note": "BigInt(456) in JavaScript becomes 456"
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
"name": "converts Date to ISO string",
|
|
24
|
-
"input": "2025-01-01T00:00:00.000Z",
|
|
25
|
-
"expected": "\"2025-01-01T00:00:00.000Z\"",
|
|
26
|
-
"specSection": "5",
|
|
27
|
-
"note": "new Date('2025-01-01T00:00:00.000Z') becomes quoted ISO string"
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"name": "converts Date in object to ISO string",
|
|
31
|
-
"input": {
|
|
32
|
-
"created": "2025-01-01T00:00:00.000Z"
|
|
33
|
-
},
|
|
34
|
-
"expected": "created: \"2025-01-01T00:00:00.000Z\"",
|
|
35
|
-
"specSection": "5"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"name": "converts undefined to null",
|
|
39
|
-
"input": null,
|
|
40
|
-
"expected": "null",
|
|
41
|
-
"specSection": "5",
|
|
42
|
-
"note": "undefined in JavaScript becomes null"
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"name": "converts undefined in object to null",
|
|
46
|
-
"input": {
|
|
47
|
-
"value": null
|
|
48
|
-
},
|
|
49
|
-
"expected": "value: null",
|
|
50
|
-
"specSection": "5",
|
|
51
|
-
"note": "undefined in JavaScript becomes null"
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
"name": "converts Infinity to null",
|
|
55
|
-
"input": null,
|
|
56
|
-
"expected": "null",
|
|
57
|
-
"specSection": "5",
|
|
58
|
-
"note": "Infinity becomes null"
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
"name": "converts negative Infinity to null",
|
|
62
|
-
"input": null,
|
|
63
|
-
"expected": "null",
|
|
64
|
-
"specSection": "5",
|
|
65
|
-
"note": "-Infinity becomes null"
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
"name": "converts NaN to null",
|
|
69
|
-
"input": null,
|
|
70
|
-
"expected": "null",
|
|
71
|
-
"specSection": "5",
|
|
72
|
-
"note": "Number.NaN becomes null"
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
"name": "converts function to null",
|
|
76
|
-
"input": null,
|
|
77
|
-
"expected": "null",
|
|
78
|
-
"specSection": "5",
|
|
79
|
-
"note": "Functions become null"
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
"name": "converts function in object to null",
|
|
83
|
-
"input": {
|
|
84
|
-
"fn": null
|
|
85
|
-
},
|
|
86
|
-
"expected": "fn: null",
|
|
87
|
-
"specSection": "5",
|
|
88
|
-
"note": "Functions become null"
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
"name": "converts symbol to null",
|
|
92
|
-
"input": null,
|
|
93
|
-
"expected": "null",
|
|
94
|
-
"specSection": "5",
|
|
95
|
-
"note": "Symbols become null"
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
"name": "converts symbol in object to null",
|
|
99
|
-
"input": {
|
|
100
|
-
"sym": null
|
|
101
|
-
},
|
|
102
|
-
"expected": "sym: null",
|
|
103
|
-
"specSection": "5",
|
|
104
|
-
"note": "Symbols become null"
|
|
105
|
-
}
|
|
106
|
-
]
|
|
107
|
-
}
|