packagist mischasigtermans/laravel-toon v1.0.0

13 hours ago

Added

  • Full TOON v3.0 specification compliance
  • Global helper functions: toon_encode() and toon_decode()
  • Spec-compliant string quoting (strings with special characters are now quoted with "...")
  • Proper escape sequences within quoted strings (\n, \r, \t, \", \\)
  • Delimiter support: comma (default), tab (\t), and pipe (|) via delimiter config option
  • Strict mode for decoding with validation errors via strict config option
  • Key folding: collapse single-key nested objects into dot notation via key_folding config
  • Path expansion: expand dotted keys back to nested objects via expand_paths config
  • Inline primitive array format (key[N]: a,b,c)
  • Official specification test fixtures from toon-format/spec

Changed

  • BREAKING: String escaping now uses quoted strings instead of backslash escaping
    • Before: message: Hello\, World\: Test
    • After: message: "Hello, World: Test"
  • BREAKING: Removed escape_style config option (no longer applicable)
  • Float encoding now preserves full IEEE 754 double precision (16 significant digits)

Migration Guide

The decoder maintains backward compatibility and parses both old backslash-escaped format and new quoted strings.

If you have code that expects the old output format:

  1. Encoded output now uses quoted strings for special characters
  2. Republish config: php artisan vendor:publish --tag=toon-config --force
  3. Set strict => false if parsing legacy TOON with formatting issues

Don't miss a new laravel-toon release

NewReleases is sending notifications on new releases.