Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: stringify
\0
as \\x00
in some cases
The following is invalid JSON5 and ES5 because a digit cannot follow a null character escape. '\01' However, JSON5 stringifies `'\x001'` as `'\01'` making it impossible to round trip. This commit ensures that JSON5 stringifies null characters as `\x00` when followed by a digit.
- Loading branch information
1 parent
cdefab8
commit 3d9c22e
Showing
2 changed files
with
16 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters