Skip to content

Commit

Permalink
Document toJSON5
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanbtucker committed Sep 25, 2017
1 parent 87aeff6 commit a6c2b14
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ This release includes major internal changes and public API enhancements.
quotes inside the string. (i.e. `stringify('Stay here.')` outputs
`'Stay here.'` while `stringify('Let\'s go.')` outputs `"Let's go."`)

- New: `stringify` checks for `toJSON5` methods on objects and, if it exists,
stringify its return value instead of the object. `toJSON5` overrides `toJSON`
if they both exist.

- New: To `require` or `import` JSON5 files, use `require('json5/lib/register')`
or `import 'json5/lib/register'`. Previous versions used `json5/lib/require`,
which still exists for backward compatibility but is deprecated and will give
Expand Down

0 comments on commit a6c2b14

Please sign in to comment.