From 79cebbdf154031accd688cfdb8568c71bed0e98d Mon Sep 17 00:00:00 2001 From: Johann Schopplich Date: Thu, 30 Oct 2025 09:15:37 +0100 Subject: [PATCH] docs: update `decode` example --- README.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index db6cef3..9d5588d 100644 --- a/README.md +++ b/README.md @@ -844,9 +844,11 @@ A JavaScript value (object, array, or primitive) representing the parsed TOON da ```ts import { decode } from '@byjohann/toon' -const toon = `items[2]{sku,qty,price}: +const toon = ` +items[2]{sku,qty,price}: A1,2,9.99 - B2,1,14.5` + B2,1,14.5 +` const data = decode(toon) // { @@ -861,10 +863,10 @@ const data = decode(toon) By default, the decoder validates input strictly: -- **Invalid escape sequences** – Throws on `"\x"`, unterminated strings -- **Syntax errors** – Throws on missing colons, malformed headers -- **Array length mismatches** – Throws when declared length doesn't match actual count -- **Delimiter mismatches** – Throws when row delimiters don't match header +- **Invalid escape sequences**: Throws on `"\x"`, unterminated strings. +- **Syntax errors**: Throws on missing colons, malformed headers. +- **Array length mismatches**: Throws when declared length doesn't match actual count. +- **Delimiter mismatches**: Throws when row delimiters don't match header. ## Notes and Limitations