Repository navigation
Highlights
- Security hardening for the JS and Go parsers
parse()no longer recurses over raw literal nesting, so deeply nested input cannot overflow the call stack.- Malformed
nulland out-of-range reference indices no longer crash the JS parser; Go returns an error instead of panicking. - The Go reviver now handles cyclic and shared graphs without unbounded recursion.
- Published advisories: GHSA-2pmx-fqfh-7m9p, GHSA-362p-2g6x-jgj9, GHSA-rpvg-j7px-h4mj, GHSA-437v-hc68-7fcr
parse(text, reviver)compatibility restored — revivers receive fully revived nested objects/arrays again, matching the pre-3.4.0 behavior andJSON.parsesemantics. Fixes #109.- Array-form replacer now matches
JSON.stringify— array elements are no longer filtered by index, and numeric entries plus nested empty-string keys are handled correctly. Fixes #106. - Official Rust port added — version 0.3.5 of the
webreflection-flattedcrate lives underrust/and is included in the npm package. The library/import name remainsflatted, so Rust code still usesuse flatted::....
Rust
Cargo searches the repository for the requested crate, so the repo root URL is correct even though Cargo.toml lives in rust/.
[dependencies]
webreflection-flatted = { git = "https://github.com/WebReflection/flatted", tag = "0.3.5" }use flatted::{parse_simple, stringify_simple, Value};Optional CLI: cargo build --release --features cli.
Thanks
Thanks to everyone who reported, reviewed, and contributed fixes for the parser issues, array replacer behavior, and the Rust port.