MCPcopy Index your code
hub / github.com/caolan/nodeunit / _deepEqual

Function _deepEqual

examples/browser/nodeunit.js:1284–1307  ·  view source on GitHub ↗
(actual, expected)

Source from the content-addressed store, hash-verified

1282};
1283
1284function _deepEqual(actual, expected) {
1285 // 7.1. All identical values are equivalent, as determined by ===.
1286 if (actual === expected) {
1287 return true;
1288 // 7.2. If the expected value is a Date object, the actual value is
1289 // equivalent if it is also a Date object that refers to the same time.
1290 } else if (actual instanceof Date && expected instanceof Date) {
1291 return actual.getTime() === expected.getTime();
1292
1293 // 7.3. Other pairs that do not both pass typeof value == "object",
1294 // equivalence is determined by ==.
1295 } else if (typeof actual != 'object' && typeof expected != 'object') {
1296 return actual == expected;
1297
1298 // 7.4. For all other Object pairs, including Array objects, equivalence is
1299 // determined by having the same number of owned properties (as verified
1300 // with Object.prototype.hasOwnProperty.call), the same set of keys
1301 // (although not necessarily the same order), equivalent values for every
1302 // corresponding key, and an identical "prototype" property. Note: this
1303 // accounts for both named and indexed properties on Arrays.
1304 } else {
1305 return objEquiv(actual, expected);
1306 }
1307}
1308
1309function isUndefinedOrNull (value) {
1310 return value === null || value === undefined;

Callers 2

nodeunit.jsFile · 0.70
objEquivFunction · 0.70

Calls 1

objEquivFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…