MCPcopy Index your code
hub / github.com/prototypejs/prototype / isDeepEqual

Function isDeepEqual

test/unit/static/js/proclaim.js:450–471  ·  view source on GitHub ↗
(actual, expected)

Source from the content-addressed store, hash-verified

448
449 // Utility for deep equality testing
450 function isDeepEqual (actual, expected) {
451 /* jshint eqeqeq: false */
452 if (actual === expected) {
453 return true;
454 }
455 if (expected instanceof Date && actual instanceof Date) {
456 return actual.getTime() === expected.getTime();
457 }
458 if (actual instanceof RegExp && expected instanceof RegExp) {
459 return (
460 actual.source === expected.source &&
461 actual.global === expected.global &&
462 actual.multiline === expected.multiline &&
463 actual.lastIndex === expected.lastIndex &&
464 actual.ignoreCase === expected.ignoreCase
465 );
466 }
467 if (typeof actual !== 'object' && typeof expected !== 'object') {
468 return actual == expected;
469 }
470 return objectsEqual(actual, expected);
471 }
472
473 // Utility for testing whether a function throws an error
474 function functionThrows (fn, expected) {

Callers 2

proclaim.jsFile · 0.70
objectsEqualFunction · 0.70

Calls 1

objectsEqualFunction · 0.70

Tested by

no test coverage detected