Safely and quickly serialize JavaScript objects
Beside adding BigInt support, this PR also ads node 12 to .travis.yml and updates standard to `^14.0.0` Not really sure about the new method names `jsonSafe` and `deterministicJsonSafe`. Resolves: #41 Had an earlier version which replaced all `JSON.stringify` calls, with a `bigintSafeJSONStringify` method (see below). But this had huge impacts on the performance (only about a third ops/sec than before). Therefore i decided to implement the toString conversion for BigInts directly in the former `decirc` method, hence the rename to `jsonSafe` as it does more then decirculate now. Performance is now about the same (sometimes faster, sometimes slower) as in master. ```js function bigintSafeJSONStringify (obj, replacer, spacer) { return JSON.stringify(obj, function (key, value) { replacer = replacer !== undefined ? replacer : function (k, v) { return v } return replacer(key, typeof value === 'bigint' ? value.toString() : value) }, spacer) } ``` Also i moved quite a bit of code from the former `decirc` method to a new `replaceProperty` method to avoid code duplication.
This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be still under discussion. The issue was opened by pixtron and has received 11 comments.