is-equal

Are these two values conceptually equal?

#is-equal

Are these two values conceptually equal?

var isEqual = require('is-equal');
var assert = require('assert');
 
var primitives = [true, false, undefined, 42, 'foo'];
primitives.forEach(function (primitive) {
    assert.equal(isEqual(primitive, primitive), true);
});
assert.equal(isEqual(/a/g, /a/g));
assert.equal(isEqual(/a/g, new RegExp('a', 'g')));
assert.equal(isEqual({ a: 2 }, { a: 2 }), true);
assert.equal(isEqual([1, [2, 3], 4], [1, [2, 3], 4]), true);
var timestamp = Date.now();
assert.equal(isEqual(new Date(timestamp), new Date(timestamp)), true);

Simply clone the repo, npm install, and run npm test