|
|
|
|
|
by bobthepanda
1408 days ago
|
|
JSON5 parse constructs a Javascript object, which can in turn be serialized by JSON 4 into valid plain JSON string. That's not an invalid way of converting the two objects. JSON.stringify is part of the standard JS spec: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... JSON5.parse() is part of JSON5's API: https://json5.org/#json5parse So any project that includes both standard JS and JSON5 could literally copy and paste this code. You're still importing JSON5, but you would presumably have to do that anyways to use JSON5. |
|
is not a convincing reply to
> so parsers already exist in every language