Uncaught TypeError: Cannot read properties of undefined (reading 'map')
at transform (/home/node_modules/mojangson/index.js:13:26)
at simplify (/home/node_modules/mojangson/index.js:17:10)
at /home/node_modules/mojangson/index.js:8:20
at Array.reduce (<anonymous>)
at transform (/home/node_modules/mojangson/index.js:7:33)
at Object.simplify (/home/node_modules/mojangson/index.js:17:10)
I think it has something to do with there being no checks to verify the "value" key exists on line 13 of index.js. Adding if (value.value == undefined) return [] to index.js fixes it in this case but there might be exceptions.
Recreation:
Output:
I think it has something to do with there being no checks to verify the "value" key exists on line 13 of index.js. Adding
if (value.value == undefined) return []
to index.js fixes it in this case but there might be exceptions.