beenotung / compress-json

Store JSON data in space efficient manner
https://www.npmjs.com/package/compress-json
BSD 2-Clause "Simplified" License
108 stars 6 forks source link

Undefined crashes compression. #6

Closed psznm closed 2 years ago

psznm commented 2 years ago

I have tested this on compress-json 1.0.5 and 2.0.1

Welcome to Node.js v16.11.0.
Type ".help" for more information.
> const {compress} = require('compress-json');
undefined
> compress({test: undefined});
Uncaught TypeError: unsupported data type: [object Undefined]
    at Object.throwUnknownDataType (.../node_modules/compress-json/dist/debug.js:8:11)
    at addValue (.../node_modules/compress-json/dist/memory.js:148:20)
    at Object.addValue (.../node_modules/compress-json/dist/memory.js:136:31)
    at compress (.../node_modules/compress-json/dist/core.js:8:27)
psznm commented 2 years ago

Nevermind this issue, I realized JSON should be passed in, not plain javascript objects...