-
Notifications
You must be signed in to change notification settings - Fork 202
Open
Description
JSONbig.stringify escapes '\u202c' while JSON.stringify does not:
Welcome to Node.js v16.20.0.
Type ".help" for more information.
> JSONbig = require('json-bigint')
[Function (anonymous)] {
parse: [Function (anonymous)],
stringify: [Function (anonymous)]
}
> x = { k: 'a\u202cz' }
{ k: 'az' }
> [...JSON.stringify(x)].map(i => i.charCodeAt(0).toString(16))
[
'7b', '22', '6b',
'22', '3a', '22',
'61', '202c', '7a',
'22', '7d'
]
> [...JSONbig.stringify(x)].map(i => i.charCodeAt(0).toString(16))
[
'7b', '22', '6b', '22',
'3a', '22', '61', '5c',
'75', '32', '30', '32',
'63', '7a', '22', '7d'
]
>
Note the absence of 202c. In its place is the escaped string "\u202c".
More parameters controlling escaping would be helpful.
Metadata
Metadata
Assignees
Labels
No labels