json-stream-stringify
json-stream-stringify copied to clipboard
Element in array is not serialized randomly
I have some code that returns:
{
someProperty: 1,
items: <a stream in objectMode result of performing a query and transforming its values>
}
Randomly, I get things rendered like it follows:
{
"someProperty": 1,
"items": [
{"id": 1},
{"id": 2},
,
{"id": 3},
,
...
]
As you see it generates invalid json. I have been trying to debug and understand what is going on. But unfortunately I cannot reproduce and I did not manage to generate a stream of objects that produces this.