deep-equal
, but only for JSON-supported values.
Note that any results you get from values that do not round-trip through JSON.stringify
and JSON.parse
are explicitly not part of this API, and you must not rely on them.
const assert = require('assert');
const deepEqual = require('deep-equal-json');
assert.equal(typeof deepEqual(a, b), 'boolean'); // `a` and `b` can be anything that roundtrips with JSON
Simply clone the repo, npm install
, and run npm test