Skip to content

Commit 4b41d26

Browse files
committed
New version: 3.5.0.
1 parent a869fb9 commit 4b41d26

6 files changed

Lines changed: 16 additions & 14 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ BSD-3-Clause
6969
7070
## Release History
7171
72+
- 3.5.0 _New `maxDepth` option on path filters. Thx [ataberk.xyz](https://github.com/ataberk-xyz)._
7273
- 3.4.0 _Deprecated `stream-json/utils/{pipe,drain}` — use `stream-chain`'s generic helpers directly; the file-edge internals now delegate to `stream-chain`._
7374
- 3.3.0 _File I/O components (`parseFile`, `stringerToFile`, `verifyFile`), faithful JSONC comma round-trip (`streamCommas` / `useCommas`), JSONL delegated to `stream-chain`._
7475
- 3.2.0 _Improvements in TS typings, faster JSON parser._

llms-full.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,7 @@ All filters are built on `filterBase` and accept these common options:
397397
- **function** `(stack, chunk) => boolean` — custom matching logic.
398398
- `pathSeparator` (string, default: `'.'`) — separator for path matching.
399399
- `once` (boolean) — if true, stop filtering after the first match.
400+
- `maxDepth` (number, default: `1024`) — maximum JSON nesting depth to evaluate; a token nested deeper throws a `RangeError`. A guard for untrusted input with unbounded nesting. Pass `Infinity` to disable.
400401
- `streamKeys` (boolean) — control key streaming in output.
401402

402403
Each filter ships in both substrates. The Node entry (`stream-json/filters/<name>.js`) has `asStream` and `asWebStream` plus `withParser`, `withParserAsStream`, and `withParserAsWebStream`. The Web entry (`stream-json/web/filters/<name>.js`) has `asWebStream` plus `withParser` and `withParserAsWebStream`, and pulls in no Node-stream imports.

llms.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ e.addEventListener('keyValue', ev => console.log(ev.detail));
118118

119119
## Filters
120120

121-
All filters accept `{filter, pathSeparator, once, streamKeys}` options. `filter` can be a string, RegExp, or `(stack, chunk) => boolean`.
121+
All filters accept `{filter, pathSeparator, once, streamKeys, maxDepth}` options. `filter` can be a string, RegExp, or `(stack, chunk) => boolean`. `maxDepth` caps the JSON nesting depth a filter evaluates (default `1024`; a deeper token throws a `RangeError`, `Infinity` disables the limit).
122122

123123
- **`pick(options)`** — passes only matching subobjects, discards the rest.
124124
- **`replace(options)`** — replaces matching subobjects. Extra option: `replacement` (function, value, or array of tokens).

package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "stream-json",
3-
"version": "3.4.0",
3+
"version": "3.5.0",
44
"description": "A micro-library of stream components for building custom JSON and JSONC processing pipelines with a minimal memory footprint — parse, filter, and transform JSON far larger than available memory with a SAX-inspired token API, on Node.js or Web Streams.",
55
"type": "module",
66
"main": "./src/index.js",
@@ -77,9 +77,9 @@
7777
},
7878
"devDependencies": {
7979
"@types/node": "^26.1.0",
80-
"nano-benchmark": "^1.0.16",
81-
"prettier": "^3.8.3",
82-
"tape-six": "^1.10.1",
80+
"nano-benchmark": "^1.1.0",
81+
"prettier": "^3.9.4",
82+
"tape-six": "^1.14.0",
8383
"tape-six-proc": "^1.3.1",
8484
"typescript": "^6.0.3"
8585
},

wiki

Submodule wiki updated from 279440a to 04c1839

0 commit comments

Comments
 (0)