Hello.
I am having a problem with this library: say I wanted to parse a simple object:
{
"a": 1,
"b": 2,
"c": [
"this",
"that"
],
"d": {
"inside": [],
"hey": null
}
} // -> variable `json: ReadableStream<string>` on the other snippet
With the following code:
const stream = json.pipeThrough(parseJsonStreamWithPaths([["a", "b", "c", "d"]]));
for await(const { path, value } of streamToIterable(stream)){
console.log(path, value);
}
I would expect to have:
[ 'a' ] 1
[ 'b' ] 2
[ 'c', 0 ] this
[ 'c', 1 ] that
[ 'd', 'inside' ] []
[ 'd', 'hey' ] null
But instead it either crashes or gives me:
[ 'c', 0 ] this
[ 'c', 1 ] that
[ 'd', 'inside' ] []
[ 'd', 'hey' ] null
What am I missing on?
Hello.
I am having a problem with this library: say I wanted to parse a simple object:
{ "a": 1, "b": 2, "c": [ "this", "that" ], "d": { "inside": [], "hey": null } } // -> variable `json: ReadableStream<string>` on the other snippetWith the following code:
I would expect to have:
But instead it either crashes or gives me:
What am I missing on?