Skip to content

v3.5.0

Latest

Choose a tag to compare

@WebReflection WebReflection released this 30 Nov 11:29
· 5 commits to main since this release

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 null and 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 and JSON.parse semantics. 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-flatted crate lives under rust/ and is included in the npm package. The library/import name remains flatted, so Rust code still uses use 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.