uhop / stream-json

The micro-library of Node.js stream components for creating custom JSON processing pipelines with a minimal memory footprint. It can parse JSON files far exceeding available memory streaming individual primitives using a SAX-inspired API.
Other
973 stars 47 forks source link

Cannot consume large numbers correctly #170

Open devashish-sood opened 3 days ago

devashish-sood commented 3 days ago

Large numbers are converted to exponential form

Given:

{ "bank": ["red", "white", "blue", "green", "yellow"], "visibles": [ { "pebbles": ["red", "blue", "green", "red", "white"], "face?": false } ], "cards": [ { "pebbles": ["red", "yellow", "green", "yellow", "white"], "face?": true } ], "players": [ { "wallet": ["red", "red", "red"], "score": 9999999999999999988935498273598701004597577818920492838394 } ] }

creating a pipeline like so:

const pipeline = process.stdin.pipe(StreamValues.withParser({}));

attempting to stream the provided input results in:

reading in { bank: [ 'red', 'white', 'blue', 'green', 'yellow' ], visibles: [ { pebbles: [Array], 'face?': false } ], cards: [ { pebbles: [Array], 'face?': true } ], players: [ { wallet: [Array], score: 1e+58 } ] }

uhop commented 2 days ago

Need more information: