We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 081f528 commit bb328eaCopy full SHA for bb328ea
src/index.ts
@@ -10,6 +10,7 @@ const escaped: Record<string, string> = {
10
'\n': '\\n',
11
'\r': '\\r',
12
'\t': '\\t',
13
+ '\0': '\\0',
14
'\u2028': '\\u2028',
15
'\u2029': '\\u2029'
16
};
test/test.ts
@@ -44,7 +44,7 @@ describe('devalue', () => {
44
test('two high surrogates', "a\uD800\uD800b", '"a\\uD800\\uD800b"');
45
test('surrogate pair', '𝌆', JSON.stringify('𝌆'));
46
test('surrogate pair in wrong order', 'a\uDC00\uD800b', '"a\\uDC00\\uD800b"');
47
- test('nul', '\0', '"\0"');
+ test('nul', '\0', '"\\0"');
48
test('backslash', '\\', JSON.stringify('\\'));
49
});
50
0 commit comments