You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Delimiter support: comma (default), tab (`\t`), and pipe (`|`) via `delimiter` config option
15
13
- Strict mode for decoding with validation errors via `strict` config option
16
-
- Official specification test suite (65 compliance tests)
14
+
- Key folding: collapse single-key nested objects into dot notation via `key_folding` config
15
+
- Path expansion: expand dotted keys back to nested objects via `expand_paths` config
16
+
- Official specification test fixtures from [toon-format/spec](https://github.com/toon-format/spec)
17
17
- Inline primitive array format (`key[N]: a,b,c`)
18
18
19
19
### Changed
@@ -24,11 +24,12 @@ All notable changes to this project will be documented in this file.
24
24
- Float encoding now preserves full IEEE 754 double precision (16 significant digits)
25
25
26
26
### Migration Guide
27
-
The decoder maintains backward compatibility and will correctly parse both the old backslash-escaped format and the new quoted string format. However, if you have code that expects the old output format, be aware that:
28
-
1. Encoded output will now use quoted strings for special characters
29
-
2. The `escape_style` config option has been removed
30
-
3. Republish config to get new options: `php artisan vendor:publish --tag=toon-config --force`
31
-
4. Set `strict => false` in config if parsing legacy TOON that may have formatting issues
27
+
The decoder maintains backward compatibility and parses both old backslash-escaped format and new quoted strings.
28
+
29
+
If you have code that expects the old output format:
30
+
1. Encoded output now uses quoted strings for special characters
Copy file name to clipboardExpand all lines: README.md
+51-56Lines changed: 51 additions & 56 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,9 +3,9 @@
3
3
[](https://packagist.org/packages/mischasigtermans/laravel-toon)
A spec-compliant TOON (Token-Optimized Object Notation) encoder/decoder for Laravelwith intelligent nested object handling.
6
+
The most complete [TOON](https://toonformat.dev/) implementation for Laravel, and the only one with full [TOON v3.0 specification](https://github.com/toon-format/spec/blob/main/SPEC.md) compliance.
7
7
8
-
TOON is a compact, YAML-like format designed to reduce token usage when sending data to LLMs. This package implements the [TOON v3.0 specification](https://github.com/toon-format/spec/blob/main/SPEC.md) and achieves **40-60% token reduction** compared to JSON while maintaining full round-trip fidelity.
8
+
TOON (Token-Optimized Object Notation) is a compact, YAML-like format designed to reduce token usage when sending data to LLMs. This package achieves **~50% token reduction** compared to JSON while maintaining full round-trip fidelity, backed by 470 tests.
9
9
10
10
## Installation
11
11
@@ -20,8 +20,8 @@ use MischaSigtermans\Toon\Facades\Toon;
When building MCP servers or LLM-powered applications, every token counts. JSON's verbosity wastes context window space with repeated keys and structural characters.
0 commit comments