MCPcopy Index your code
hub / github.com/nodejs/node / innerDeepEqual

Function innerDeepEqual

lib/internal/util/comparisons.js:238–269  ·  view source on GitHub ↗
(val1, val2, mode, memos)

Source from the content-addressed store, hash-verified

236}
237
238function innerDeepEqual(val1, val2, mode, memos) {
239 // All identical values are equivalent, as determined by ===.
240 if (val1 === val2) {
241 return val1 !== 0 || ObjectIs(val1, val2) || mode === kLoose;
242 }
243
244 // Check more closely if val1 and val2 are equal.
245 if (mode !== kLoose) {
246 if (typeof val1 === 'number') {
247 // Check for NaN
248 // eslint-disable-next-line no-self-compare
249 return val1 !== val1 && val2 !== val2;
250 }
251 if (typeof val2 !== 'object' ||
252 typeof val1 !== 'object' ||
253 val1 === null ||
254 val2 === null) {
255 return false;
256 }
257 } else {
258 if (val1 === null || typeof val1 !== 'object') {
259 return (val2 === null || typeof val2 !== 'object') &&
260 // Check for NaN
261 // eslint-disable-next-line eqeqeq, no-self-compare
262 (val1 == val2 || (val1 !== val1 && val2 !== val2));
263 }
264 if (val2 === null || typeof val2 !== 'object') {
265 return false;
266 }
267 }
268 return objectComparisonStart(val1, val2, mode, memos);
269}
270
271function hasUnequalTag(val1, val2) {
272 return val1[SymbolToStringTag] !== val2[SymbolToStringTag];

Callers 14

isEnumerableOrIdenticalFunction · 0.85
objectComparisonStartFunction · 0.85
mapMightHaveLoosePrimFunction · 0.85
partialObjectSetEquivFunction · 0.85
compareSmallSetsFunction · 0.85
partialObjectMapEquivFunction · 0.85
arrayHasEqualMapElementFunction · 0.85
mapObjectEquivFunction · 0.85
mapEquivFunction · 0.85
partialSparseArrayEquivFunction · 0.85
partialArrayEquivFunction · 0.85
sparseArrayEquivFunction · 0.85

Calls 1

objectComparisonStartFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…