@toon-format/spec 3.0.1 → 3.0.2
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/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# TOON Format Specification
|
|
2
2
|
|
|
3
3
|
[](./SPEC.md)
|
|
4
|
-
[](./tests/fixtures/)
|
|
5
5
|
[](./LICENSE)
|
|
6
6
|
|
|
7
7
|
This repository contains the official specification for **Token-Oriented Object Notation (TOON)**, a compact, human-readable encoding of the JSON data model for LLM prompts. It provides a lossless serialization of the same objects, arrays, and primitives as JSON, but in a syntax that minimizes tokens and makes structure easy for models to follow.
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toon-format/spec",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.0.
|
|
5
|
-
"packageManager": "pnpm@10.
|
|
4
|
+
"version": "3.0.2",
|
|
5
|
+
"packageManager": "pnpm@10.30.1",
|
|
6
6
|
"description": "Official specification for Token-Oriented Object Notation (TOON)",
|
|
7
7
|
"author": "Johann Schopplich <hello@johannschopplich.com>",
|
|
8
8
|
"license": "MIT",
|
|
@@ -34,9 +34,8 @@
|
|
|
34
34
|
"release": "bumpp"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@antfu/eslint-config": "^
|
|
38
|
-
"bumpp": "^10.
|
|
39
|
-
"eslint": "^
|
|
40
|
-
"vitest": "^4.0.6"
|
|
37
|
+
"@antfu/eslint-config": "^7.4.3",
|
|
38
|
+
"bumpp": "^10.4.1",
|
|
39
|
+
"eslint": "^10.0.1"
|
|
41
40
|
}
|
|
42
41
|
}
|
|
@@ -91,6 +91,14 @@
|
|
|
91
91
|
},
|
|
92
92
|
"specSection": "9.1"
|
|
93
93
|
},
|
|
94
|
+
{
|
|
95
|
+
"name": "parses quoted empty string key with inline array",
|
|
96
|
+
"input": "\"\"[3]: 1,2,3",
|
|
97
|
+
"expected": {
|
|
98
|
+
"": [1, 2, 3]
|
|
99
|
+
},
|
|
100
|
+
"specSection": "9.1"
|
|
101
|
+
},
|
|
94
102
|
{
|
|
95
103
|
"name": "parses quoted key containing brackets with inline array",
|
|
96
104
|
"input": "\"key[test]\"[3]: 1,2,3",
|
|
@@ -106,6 +114,14 @@
|
|
|
106
114
|
"x-custom": []
|
|
107
115
|
},
|
|
108
116
|
"specSection": "9.1"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"name": "parses quoted empty string key with empty array",
|
|
120
|
+
"input": "\"\"[0]:",
|
|
121
|
+
"expected": {
|
|
122
|
+
"": []
|
|
123
|
+
},
|
|
124
|
+
"specSection": "9.1"
|
|
109
125
|
}
|
|
110
126
|
]
|
|
111
127
|
}
|
|
@@ -58,6 +58,17 @@
|
|
|
58
58
|
},
|
|
59
59
|
"specSection": "9.3"
|
|
60
60
|
},
|
|
61
|
+
{
|
|
62
|
+
"name": "parses quoted empty string key with tabular array format",
|
|
63
|
+
"input": "\"\"[2]{id,name}:\n 1,Ada\n 2,Bob",
|
|
64
|
+
"expected": {
|
|
65
|
+
"": [
|
|
66
|
+
{ "id": 1, "name": "Ada" },
|
|
67
|
+
{ "id": 2, "name": "Bob" }
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
"specSection": "9.3"
|
|
71
|
+
},
|
|
61
72
|
{
|
|
62
73
|
"name": "treats unquoted colon as terminator for tabular rows and start of key-value pair",
|
|
63
74
|
"input": "items[2]{id,name}:\n 1,Alice\n 2,Bob\ncount: 2",
|
|
@@ -35,6 +35,22 @@
|
|
|
35
35
|
"expected": "items[0]:",
|
|
36
36
|
"specSection": "9.1"
|
|
37
37
|
},
|
|
38
|
+
{
|
|
39
|
+
"name": "encodes empty string keys for inline arrays",
|
|
40
|
+
"input": {
|
|
41
|
+
"": [1, 2, 3]
|
|
42
|
+
},
|
|
43
|
+
"expected": "\"\"[3]: 1,2,3",
|
|
44
|
+
"specSection": "9.1"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"name": "encodes empty string keys for empty arrays",
|
|
48
|
+
"input": {
|
|
49
|
+
"": []
|
|
50
|
+
},
|
|
51
|
+
"expected": "\"\"[0]:",
|
|
52
|
+
"specSection": "9.1"
|
|
53
|
+
},
|
|
38
54
|
{
|
|
39
55
|
"name": "encodes empty string in single-item array",
|
|
40
56
|
"input": {
|
|
@@ -57,6 +57,17 @@
|
|
|
57
57
|
},
|
|
58
58
|
"expected": "items[2]{\"order:id\",\"full name\"}:\n 1,Ada\n 2,Bob",
|
|
59
59
|
"specSection": "9.3"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"name": "encodes tabular arrays with empty string keys",
|
|
63
|
+
"input": {
|
|
64
|
+
"": [
|
|
65
|
+
{ "id": 1, "name": "Ada" },
|
|
66
|
+
{ "id": 2, "name": "Bob" }
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
"expected": "\"\"[2]{id,name}:\n 1,Ada\n 2,Bob",
|
|
70
|
+
"specSection": "9.3"
|
|
60
71
|
}
|
|
61
72
|
]
|
|
62
73
|
}
|