Closed ChipmunkMC closed 1 year ago
can you show something this fixes?
@u9g This fixes:
> const snbt = require('mojangson')
undefined
> const nbt = require('prismarine-nbt')
undefined
> snbt.parse('"1b"')
{ value: 1, type: 'byte' }
> snbt.stringify(nbt.comp({ string: nbt.string("'this string will be normalized twice") }))
`{string:"\\"'this string will be normalized twice\\""}`
> snbt.stringify(nbt.string("a character that isnt allowed in unquoted strings \u6969"))
'a character that isnt allowed in unquoted strings 楩'
can you add that to the tests ?
can you add that to the tests ?
Sorry for the delay, I added some strings to the stringify test data, to test quoting.
conflicts
please re-open if you want to finish it
normalizeString
is now used on key names in compounds, and the check for keys named 'string' was removed/[^0-9A-Za-z_\-.+]/
"1b"
is now fixed