fast-equals 5.3.4 → 5.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -32
- package/dist/cjs/comparator.d.cts +2 -0
- package/dist/cjs/equals.d.cts +8 -0
- package/dist/cjs/index.cjs +51 -19
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/internalTypes.d.cts +11 -7
- package/dist/es/comparator.d.mts +2 -0
- package/dist/es/equals.d.mts +8 -0
- package/dist/es/index.mjs +51 -19
- package/dist/es/index.mjs.map +1 -1
- package/dist/es/internalTypes.d.mts +11 -7
- package/dist/umd/comparator.d.ts +1 -1
- package/dist/umd/equals.d.ts +8 -0
- package/dist/umd/index.js +51 -19
- package/dist/umd/index.js.map +1 -1
- package/dist/umd/internalTypes.d.ts +10 -8
- package/index.d.ts +11 -7
- package/package.json +2 -2
package/dist/es/index.mjs
CHANGED
|
@@ -63,6 +63,12 @@ const PREACT_VNODE = '__v';
|
|
|
63
63
|
const PREACT_OWNER = '__o';
|
|
64
64
|
const REACT_OWNER = '_owner';
|
|
65
65
|
const { getOwnPropertyDescriptor, keys } = Object;
|
|
66
|
+
/**
|
|
67
|
+
* Whether the array buffers are equal in value.
|
|
68
|
+
*/
|
|
69
|
+
function areArrayBuffersEqual(a, b) {
|
|
70
|
+
return a.byteLength === b.byteLength && areTypedArraysEqual(new Uint8Array(a), new Uint8Array(b));
|
|
71
|
+
}
|
|
66
72
|
/**
|
|
67
73
|
* Whether the arrays are equal in value.
|
|
68
74
|
*/
|
|
@@ -78,6 +84,13 @@ function areArraysEqual(a, b, state) {
|
|
|
78
84
|
}
|
|
79
85
|
return true;
|
|
80
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* Whether the dataviews are equal in value.
|
|
89
|
+
*/
|
|
90
|
+
function areDataViewsEqual(a, b) {
|
|
91
|
+
return (a.byteLength === b.byteLength
|
|
92
|
+
&& areTypedArraysEqual(new Uint8Array(a.buffer, a.byteOffset, a.byteLength), new Uint8Array(b.buffer, b.byteOffset, b.byteLength)));
|
|
93
|
+
}
|
|
81
94
|
/**
|
|
82
95
|
* Whether the dates passed are equal in value.
|
|
83
96
|
*/
|
|
@@ -260,8 +273,8 @@ function areSetsEqual(a, b, state) {
|
|
|
260
273
|
* Whether the TypedArray instances are equal in value.
|
|
261
274
|
*/
|
|
262
275
|
function areTypedArraysEqual(a, b) {
|
|
263
|
-
let index = a.
|
|
264
|
-
if (b.
|
|
276
|
+
let index = a.byteLength;
|
|
277
|
+
if (b.byteLength !== index || a.byteOffset !== b.byteOffset) {
|
|
265
278
|
return false;
|
|
266
279
|
}
|
|
267
280
|
while (index-- > 0) {
|
|
@@ -291,8 +304,10 @@ function isPropertyEqual(a, b, state, property) {
|
|
|
291
304
|
return hasOwn(b, property) && state.equals(a[property], b[property], property, property, a, b, state);
|
|
292
305
|
}
|
|
293
306
|
|
|
307
|
+
const ARRAY_BUFFER_TAG = '[object ArrayBuffer]';
|
|
294
308
|
const ARGUMENTS_TAG = '[object Arguments]';
|
|
295
309
|
const BOOLEAN_TAG = '[object Boolean]';
|
|
310
|
+
const DATA_VIEW_TAG = '[object DataView]';
|
|
296
311
|
const DATE_TAG = '[object Date]';
|
|
297
312
|
const ERROR_TAG = '[object Error]';
|
|
298
313
|
const MAP_TAG = '[object Map]';
|
|
@@ -301,18 +316,27 @@ const OBJECT_TAG = '[object Object]';
|
|
|
301
316
|
const REG_EXP_TAG = '[object RegExp]';
|
|
302
317
|
const SET_TAG = '[object Set]';
|
|
303
318
|
const STRING_TAG = '[object String]';
|
|
319
|
+
const TYPED_ARRAY_TAGS = {
|
|
320
|
+
'[object Int8Array]': true,
|
|
321
|
+
'[object Uint8Array]': true,
|
|
322
|
+
'[object Uint8ClampedArray]': true,
|
|
323
|
+
'[object Int16Array]': true,
|
|
324
|
+
'[object Uint16Array]': true,
|
|
325
|
+
'[object Int32Array]': true,
|
|
326
|
+
'[object Uint32Array]': true,
|
|
327
|
+
'[object Float16Array]': true,
|
|
328
|
+
'[object Float32Array]': true,
|
|
329
|
+
'[object Float64Array]': true,
|
|
330
|
+
'[object BigInt64Array]': true,
|
|
331
|
+
'[object BigUint64Array]': true,
|
|
332
|
+
};
|
|
304
333
|
const URL_TAG = '[object URL]';
|
|
305
|
-
const { isArray } = Array;
|
|
306
|
-
const isTypedArray =
|
|
307
334
|
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
308
|
-
|
|
309
|
-
const { assign } = Object;
|
|
310
|
-
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
311
|
-
const getTag = Object.prototype.toString.call.bind(Object.prototype.toString);
|
|
335
|
+
const toString = Object.prototype.toString;
|
|
312
336
|
/**
|
|
313
337
|
* Create a comparator method based on the type-specific equality comparators passed.
|
|
314
338
|
*/
|
|
315
|
-
function createEqualityComparator({ areArraysEqual, areDatesEqual, areErrorsEqual, areFunctionsEqual, areMapsEqual, areNumbersEqual, areObjectsEqual, arePrimitiveWrappersEqual, areRegExpsEqual, areSetsEqual, areTypedArraysEqual, areUrlsEqual, unknownTagComparators, }) {
|
|
339
|
+
function createEqualityComparator({ areArrayBuffersEqual, areArraysEqual, areDataViewsEqual, areDatesEqual, areErrorsEqual, areFunctionsEqual, areMapsEqual, areNumbersEqual, areObjectsEqual, arePrimitiveWrappersEqual, areRegExpsEqual, areSetsEqual, areTypedArraysEqual, areUrlsEqual, unknownTagComparators, }) {
|
|
316
340
|
/**
|
|
317
341
|
* compare the value of the two objects and return true if they are equivalent in values
|
|
318
342
|
*/
|
|
@@ -362,14 +386,9 @@ function createEqualityComparator({ areArraysEqual, areDatesEqual, areErrorsEqua
|
|
|
362
386
|
}
|
|
363
387
|
// `isArray()` works on subclasses and is cross-realm, so we can avoid capturing
|
|
364
388
|
// the string tag or doing an `instanceof` check.
|
|
365
|
-
if (isArray(a)) {
|
|
389
|
+
if (Array.isArray(a)) {
|
|
366
390
|
return areArraysEqual(a, b, state);
|
|
367
391
|
}
|
|
368
|
-
// `isTypedArray()` works on all possible TypedArray classes, so we can avoid
|
|
369
|
-
// capturing the string tag or comparing against all possible constructors.
|
|
370
|
-
if (isTypedArray != null && isTypedArray(a)) {
|
|
371
|
-
return areTypedArraysEqual(a, b, state);
|
|
372
|
-
}
|
|
373
392
|
// Try to fast-path equality checks for other complex object types in the
|
|
374
393
|
// same realm to avoid capturing the string tag. Strict equality is used
|
|
375
394
|
// instead of `instanceof` because it is more performant for the common
|
|
@@ -389,7 +408,7 @@ function createEqualityComparator({ areArraysEqual, areDatesEqual, areErrorsEqua
|
|
|
389
408
|
}
|
|
390
409
|
// Since this is a custom object, capture the string tag to determing its type.
|
|
391
410
|
// This is reasonably performant in modern environments like v8 and SpiderMonkey.
|
|
392
|
-
const tag =
|
|
411
|
+
const tag = toString.call(a);
|
|
393
412
|
if (tag === DATE_TAG) {
|
|
394
413
|
return areDatesEqual(a, b, state);
|
|
395
414
|
}
|
|
@@ -424,6 +443,15 @@ function createEqualityComparator({ areArraysEqual, areDatesEqual, areErrorsEqua
|
|
|
424
443
|
if (tag === ARGUMENTS_TAG) {
|
|
425
444
|
return areObjectsEqual(a, b, state);
|
|
426
445
|
}
|
|
446
|
+
if (TYPED_ARRAY_TAGS[tag]) {
|
|
447
|
+
return areTypedArraysEqual(a, b, state);
|
|
448
|
+
}
|
|
449
|
+
if (tag === ARRAY_BUFFER_TAG) {
|
|
450
|
+
return areArrayBuffersEqual(a, b, state);
|
|
451
|
+
}
|
|
452
|
+
if (tag === DATA_VIEW_TAG) {
|
|
453
|
+
return areDataViewsEqual(a, b, state);
|
|
454
|
+
}
|
|
427
455
|
// As the penultimate fallback, check if the values passed are primitive wrappers. This
|
|
428
456
|
// is very rare in modern JS, which is why it is deprioritized compared to all other object
|
|
429
457
|
// types.
|
|
@@ -463,7 +491,9 @@ function createEqualityComparator({ areArraysEqual, areDatesEqual, areErrorsEqua
|
|
|
463
491
|
*/
|
|
464
492
|
function createEqualityComparatorConfig({ circular, createCustomConfig, strict, }) {
|
|
465
493
|
let config = {
|
|
494
|
+
areArrayBuffersEqual,
|
|
466
495
|
areArraysEqual: strict ? areObjectsEqualStrict : areArraysEqual,
|
|
496
|
+
areDataViewsEqual,
|
|
467
497
|
areDatesEqual: areDatesEqual,
|
|
468
498
|
areErrorsEqual: areErrorsEqual,
|
|
469
499
|
areFunctionsEqual: areFunctionsEqual,
|
|
@@ -473,19 +503,21 @@ function createEqualityComparatorConfig({ circular, createCustomConfig, strict,
|
|
|
473
503
|
arePrimitiveWrappersEqual: arePrimitiveWrappersEqual,
|
|
474
504
|
areRegExpsEqual: areRegExpsEqual,
|
|
475
505
|
areSetsEqual: strict ? combineComparators(areSetsEqual, areObjectsEqualStrict) : areSetsEqual,
|
|
476
|
-
areTypedArraysEqual: strict
|
|
506
|
+
areTypedArraysEqual: strict
|
|
507
|
+
? combineComparators(areTypedArraysEqual, areObjectsEqualStrict)
|
|
508
|
+
: areTypedArraysEqual,
|
|
477
509
|
areUrlsEqual: areUrlsEqual,
|
|
478
510
|
unknownTagComparators: undefined,
|
|
479
511
|
};
|
|
480
512
|
if (createCustomConfig) {
|
|
481
|
-
config = assign({}, config, createCustomConfig(config));
|
|
513
|
+
config = Object.assign({}, config, createCustomConfig(config));
|
|
482
514
|
}
|
|
483
515
|
if (circular) {
|
|
484
516
|
const areArraysEqual = createIsCircular(config.areArraysEqual);
|
|
485
517
|
const areMapsEqual = createIsCircular(config.areMapsEqual);
|
|
486
518
|
const areObjectsEqual = createIsCircular(config.areObjectsEqual);
|
|
487
519
|
const areSetsEqual = createIsCircular(config.areSetsEqual);
|
|
488
|
-
config = assign({}, config, {
|
|
520
|
+
config = Object.assign({}, config, {
|
|
489
521
|
areArraysEqual,
|
|
490
522
|
areMapsEqual,
|
|
491
523
|
areObjectsEqual,
|
package/dist/es/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../src/utils.ts","../../../src/equals.ts","../../../src/comparator.ts","../../../src/index.ts"],"sourcesContent":["import type {\n AnyEqualityComparator,\n Cache,\n CircularState,\n Dictionary,\n State,\n TypeEqualityComparator,\n} from './internalTypes.js';\n\nconst { getOwnPropertyNames, getOwnPropertySymbols } = Object;\n// eslint-disable-next-line @typescript-eslint/unbound-method\nconst { hasOwnProperty } = Object.prototype;\n\n/**\n * Combine two comparators into a single comparators.\n */\nexport function combineComparators<Meta>(\n comparatorA: AnyEqualityComparator<Meta>,\n comparatorB: AnyEqualityComparator<Meta>,\n) {\n return function isEqual<A, B>(a: A, b: B, state: State<Meta>) {\n return comparatorA(a, b, state) && comparatorB(a, b, state);\n };\n}\n\n/**\n * Wrap the provided `areItemsEqual` method to manage the circular state, allowing\n * for circular references to be safely included in the comparison without creating\n * stack overflows.\n */\nexport function createIsCircular<AreItemsEqual extends TypeEqualityComparator<any, any>>(\n areItemsEqual: AreItemsEqual,\n): AreItemsEqual {\n return function isCircular(a: any, b: any, state: CircularState<Cache<any, any>>) {\n if (!a || !b || typeof a !== 'object' || typeof b !== 'object') {\n return areItemsEqual(a, b, state);\n }\n\n const { cache } = state;\n\n const cachedA = cache.get(a);\n const cachedB = cache.get(b);\n\n if (cachedA && cachedB) {\n return cachedA === b && cachedB === a;\n }\n\n cache.set(a, b);\n cache.set(b, a);\n\n const result = areItemsEqual(a, b, state);\n\n cache.delete(a);\n cache.delete(b);\n\n return result;\n } as AreItemsEqual;\n}\n\n/**\n * Get the `@@toStringTag` of the value, if it exists.\n */\nexport function getShortTag(value: any): string | undefined {\n return value != null ? (value[Symbol.toStringTag] as string) : undefined;\n}\n\n/**\n * Get the properties to strictly examine, which include both own properties that are\n * not enumerable and symbol properties.\n */\nexport function getStrictProperties(object: Dictionary): Array<string | symbol> {\n return (getOwnPropertyNames(object) as Array<string | symbol>).concat(getOwnPropertySymbols(object));\n}\n\n/**\n * Whether the object contains the property passed as an own property.\n */\nexport const hasOwn =\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n Object.hasOwn || ((object: Dictionary, property: number | string | symbol) => hasOwnProperty.call(object, property));\n\n/**\n * Whether the values passed are strictly equal or both NaN.\n */\nexport function sameValueZeroEqual(a: any, b: any): boolean {\n return a === b || (!a && !b && a !== a && b !== b);\n}\n","import type { Dictionary, PrimitiveWrapper, State, TypedArray } from './internalTypes.js';\nimport { getStrictProperties, hasOwn, sameValueZeroEqual } from './utils.js';\n\nconst PREACT_VNODE = '__v';\nconst PREACT_OWNER = '__o';\nconst REACT_OWNER = '_owner';\n\nconst { getOwnPropertyDescriptor, keys } = Object;\n\n/**\n * Whether the arrays are equal in value.\n */\nexport function areArraysEqual(a: any[], b: any[], state: State<any>) {\n let index = a.length;\n\n if (b.length !== index) {\n return false;\n }\n\n while (index-- > 0) {\n if (!state.equals(a[index], b[index], index, index, a, b, state)) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the dates passed are equal in value.\n */\nexport function areDatesEqual(a: Date, b: Date): boolean {\n return sameValueZeroEqual(a.getTime(), b.getTime());\n}\n\n/**\n * Whether the errors passed are equal in value.\n */\nexport function areErrorsEqual(a: Error, b: Error): boolean {\n return a.name === b.name && a.message === b.message && a.cause === b.cause && a.stack === b.stack;\n}\n\n/**\n * Whether the functions passed are equal in value.\n */\nexport function areFunctionsEqual(a: (...args: any[]) => any, b: (...args: any[]) => any): boolean {\n return a === b;\n}\n\n/**\n * Whether the `Map`s are equal in value.\n */\nexport function areMapsEqual(a: Map<any, any>, b: Map<any, any>, state: State<any>): boolean {\n const size = a.size;\n\n if (size !== b.size) {\n return false;\n }\n\n if (!size) {\n return true;\n }\n\n const matchedIndices = new Array<true | undefined>(size);\n const aIterable = a.entries();\n\n let aResult: IteratorResult<[any, any]>;\n let bResult: IteratorResult<[any, any]>;\n let index = 0;\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while ((aResult = aIterable.next())) {\n if (aResult.done) {\n break;\n }\n\n const bIterable = b.entries();\n\n let hasMatch = false;\n let matchIndex = 0;\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while ((bResult = bIterable.next())) {\n if (bResult.done) {\n break;\n }\n\n if (matchedIndices[matchIndex]) {\n matchIndex++;\n continue;\n }\n\n const aEntry = aResult.value;\n const bEntry = bResult.value;\n\n if (\n state.equals(aEntry[0], bEntry[0], index, matchIndex, a, b, state)\n && state.equals(aEntry[1], bEntry[1], aEntry[0], bEntry[0], a, b, state)\n ) {\n hasMatch = matchedIndices[matchIndex] = true;\n break;\n }\n\n matchIndex++;\n }\n\n if (!hasMatch) {\n return false;\n }\n\n index++;\n }\n\n return true;\n}\n\n/**\n * Whether the numbers are equal in value.\n */\nexport const areNumbersEqual = sameValueZeroEqual;\n\n/**\n * Whether the objects are equal in value.\n */\nexport function areObjectsEqual(a: Dictionary, b: Dictionary, state: State<any>): boolean {\n const properties = keys(a);\n\n let index = properties.length;\n\n if (keys(b).length !== index) {\n return false;\n }\n\n // Decrementing `while` showed faster results than either incrementing or\n // decrementing `for` loop and than an incrementing `while` loop. Declarative\n // methods like `some` / `every` were not used to avoid incurring the garbage\n // cost of anonymous callbacks.\n while (index-- > 0) {\n if (!isPropertyEqual(a, b, state, properties[index]!)) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the objects are equal in value with strict property checking.\n */\nexport function areObjectsEqualStrict(a: Dictionary, b: Dictionary, state: State<any>): boolean {\n const properties = getStrictProperties(a);\n\n let index = properties.length;\n\n if (getStrictProperties(b).length !== index) {\n return false;\n }\n\n let property: string | symbol;\n let descriptorA: ReturnType<typeof getOwnPropertyDescriptor>;\n let descriptorB: ReturnType<typeof getOwnPropertyDescriptor>;\n\n // Decrementing `while` showed faster results than either incrementing or\n // decrementing `for` loop and than an incrementing `while` loop. Declarative\n // methods like `some` / `every` were not used to avoid incurring the garbage\n // cost of anonymous callbacks.\n while (index-- > 0) {\n property = properties[index]!;\n\n if (!isPropertyEqual(a, b, state, property)) {\n return false;\n }\n\n descriptorA = getOwnPropertyDescriptor(a, property);\n descriptorB = getOwnPropertyDescriptor(b, property);\n\n if (\n (descriptorA || descriptorB)\n && (!descriptorA\n || !descriptorB\n || descriptorA.configurable !== descriptorB.configurable\n || descriptorA.enumerable !== descriptorB.enumerable\n || descriptorA.writable !== descriptorB.writable)\n ) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the primitive wrappers passed are equal in value.\n */\nexport function arePrimitiveWrappersEqual(a: PrimitiveWrapper, b: PrimitiveWrapper): boolean {\n return sameValueZeroEqual(a.valueOf(), b.valueOf());\n}\n\n/**\n * Whether the regexps passed are equal in value.\n */\nexport function areRegExpsEqual(a: RegExp, b: RegExp): boolean {\n return a.source === b.source && a.flags === b.flags;\n}\n\n/**\n * Whether the `Set`s are equal in value.\n */\nexport function areSetsEqual(a: Set<any>, b: Set<any>, state: State<any>): boolean {\n const size = a.size;\n\n if (size !== b.size) {\n return false;\n }\n\n if (!size) {\n return true;\n }\n\n const matchedIndices = new Array<true | undefined>(size);\n const aIterable = a.values();\n\n let aResult: IteratorResult<any>;\n let bResult: IteratorResult<any>;\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while ((aResult = aIterable.next())) {\n if (aResult.done) {\n break;\n }\n\n const bIterable = b.values();\n\n let hasMatch = false;\n let matchIndex = 0;\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while ((bResult = bIterable.next())) {\n if (bResult.done) {\n break;\n }\n\n if (\n !matchedIndices[matchIndex]\n && state.equals(aResult.value, bResult.value, aResult.value, bResult.value, a, b, state)\n ) {\n hasMatch = matchedIndices[matchIndex] = true;\n break;\n }\n\n matchIndex++;\n }\n\n if (!hasMatch) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the TypedArray instances are equal in value.\n */\nexport function areTypedArraysEqual(a: TypedArray, b: TypedArray) {\n let index = a.length;\n\n if (b.length !== index) {\n return false;\n }\n\n while (index-- > 0) {\n if (a[index] !== b[index]) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the URL instances are equal in value.\n */\nexport function areUrlsEqual(a: URL, b: URL): boolean {\n return (\n a.hostname === b.hostname\n && a.pathname === b.pathname\n && a.protocol === b.protocol\n && a.port === b.port\n && a.hash === b.hash\n && a.username === b.username\n && a.password === b.password\n );\n}\n\nfunction isPropertyEqual(a: Dictionary, b: Dictionary, state: State<any>, property: string | symbol) {\n if (\n (property === REACT_OWNER || property === PREACT_OWNER || property === PREACT_VNODE)\n && (a.$$typeof || b.$$typeof)\n ) {\n return true;\n }\n\n return hasOwn(b, property) && state.equals(a[property], b[property], property, property, a, b, state);\n}\n","import {\n areArraysEqual as areArraysEqualDefault,\n areDatesEqual as areDatesEqualDefault,\n areErrorsEqual as areErrorsEqualDefault,\n areFunctionsEqual as areFunctionsEqualDefault,\n areMapsEqual as areMapsEqualDefault,\n areNumbersEqual as areNumbersEqualDefault,\n areObjectsEqual as areObjectsEqualDefault,\n areObjectsEqualStrict as areObjectsEqualStrictDefault,\n arePrimitiveWrappersEqual as arePrimitiveWrappersEqualDefault,\n areRegExpsEqual as areRegExpsEqualDefault,\n areSetsEqual as areSetsEqualDefault,\n areTypedArraysEqual as areTypedArraysEqualDefault,\n areUrlsEqual as areUrlsEqualDefault,\n} from './equals.js';\nimport type {\n ComparatorConfig,\n CreateState,\n CustomEqualCreatorOptions,\n EqualityComparator,\n InternalEqualityComparator,\n State,\n} from './internalTypes.js';\nimport { combineComparators, createIsCircular, getShortTag } from './utils.js';\n\nconst ARGUMENTS_TAG = '[object Arguments]';\nconst BOOLEAN_TAG = '[object Boolean]';\nconst DATE_TAG = '[object Date]';\nconst ERROR_TAG = '[object Error]';\nconst MAP_TAG = '[object Map]';\nconst NUMBER_TAG = '[object Number]';\nconst OBJECT_TAG = '[object Object]';\nconst REG_EXP_TAG = '[object RegExp]';\nconst SET_TAG = '[object Set]';\nconst STRING_TAG = '[object String]';\nconst URL_TAG = '[object URL]';\n\nconst { isArray } = Array;\nconst isTypedArray =\n // eslint-disable-next-line @typescript-eslint/unbound-method\n typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' ? ArrayBuffer.isView : null;\nconst { assign } = Object;\n// eslint-disable-next-line @typescript-eslint/unbound-method\nconst getTag = Object.prototype.toString.call.bind(Object.prototype.toString) as (a: object) => string;\n\ninterface CreateIsEqualOptions<Meta> {\n circular: boolean;\n comparator: EqualityComparator<Meta>;\n createState: CreateState<Meta> | undefined;\n equals: InternalEqualityComparator<Meta>;\n strict: boolean;\n}\n\n/**\n * Create a comparator method based on the type-specific equality comparators passed.\n */\nexport function createEqualityComparator<Meta>({\n areArraysEqual,\n areDatesEqual,\n areErrorsEqual,\n areFunctionsEqual,\n areMapsEqual,\n areNumbersEqual,\n areObjectsEqual,\n arePrimitiveWrappersEqual,\n areRegExpsEqual,\n areSetsEqual,\n areTypedArraysEqual,\n areUrlsEqual,\n unknownTagComparators,\n}: ComparatorConfig<Meta>): EqualityComparator<Meta> {\n /**\n * compare the value of the two objects and return true if they are equivalent in values\n */\n return function comparator(a: any, b: any, state: State<Meta>): boolean {\n // If the items are strictly equal, no need to do a value comparison.\n if (a === b) {\n return true;\n }\n\n // If either of the items are nullish and fail the strictly equal check\n // above, then they must be unequal.\n if (a == null || b == null) {\n return false;\n }\n\n const type = typeof a;\n\n if (type !== typeof b) {\n return false;\n }\n\n if (type !== 'object') {\n if (type === 'number') {\n return areNumbersEqual(a, b, state);\n }\n\n if (type === 'function') {\n return areFunctionsEqual(a, b, state);\n }\n\n // If a primitive value that is not strictly equal, it must be unequal.\n return false;\n }\n\n const constructor = a.constructor;\n\n // Checks are listed in order of commonality of use-case:\n // 1. Common complex object types (plain object, array)\n // 2. Common data values (date, regexp)\n // 3. Less-common complex object types (map, set)\n // 4. Less-common data values (promise, primitive wrappers)\n // Inherently this is both subjective and assumptive, however\n // when reviewing comparable libraries in the wild this order\n // appears to be generally consistent.\n\n // Constructors should match, otherwise there is potential for false positives\n // between class and subclass or custom object and POJO.\n if (constructor !== b.constructor) {\n return false;\n }\n\n // `isPlainObject` only checks against the object's own realm. Cross-realm\n // comparisons are rare, and will be handled in the ultimate fallback, so\n // we can avoid capturing the string tag.\n if (constructor === Object) {\n return areObjectsEqual(a, b, state);\n }\n\n // `isArray()` works on subclasses and is cross-realm, so we can avoid capturing\n // the string tag or doing an `instanceof` check.\n if (isArray(a)) {\n return areArraysEqual(a, b, state);\n }\n\n // `isTypedArray()` works on all possible TypedArray classes, so we can avoid\n // capturing the string tag or comparing against all possible constructors.\n if (isTypedArray != null && isTypedArray(a)) {\n return areTypedArraysEqual(a, b, state);\n }\n\n // Try to fast-path equality checks for other complex object types in the\n // same realm to avoid capturing the string tag. Strict equality is used\n // instead of `instanceof` because it is more performant for the common\n // use-case. If someone is subclassing a native class, it will be handled\n // with the string tag comparison.\n\n if (constructor === Date) {\n return areDatesEqual(a, b, state);\n }\n\n if (constructor === RegExp) {\n return areRegExpsEqual(a, b, state);\n }\n\n if (constructor === Map) {\n return areMapsEqual(a, b, state);\n }\n\n if (constructor === Set) {\n return areSetsEqual(a, b, state);\n }\n\n // Since this is a custom object, capture the string tag to determing its type.\n // This is reasonably performant in modern environments like v8 and SpiderMonkey.\n const tag = getTag(a as object);\n\n if (tag === DATE_TAG) {\n return areDatesEqual(a, b, state);\n }\n\n // For RegExp, the properties are not enumerable, and therefore will give false positives if\n // tested like a standard object.\n if (tag === REG_EXP_TAG) {\n return areRegExpsEqual(a, b, state);\n }\n\n if (tag === MAP_TAG) {\n return areMapsEqual(a, b, state);\n }\n\n if (tag === SET_TAG) {\n return areSetsEqual(a, b, state);\n }\n\n if (tag === OBJECT_TAG) {\n // The exception for value comparison is custom `Promise`-like class instances. These should\n // be treated the same as standard `Promise` objects, which means strict equality, and if\n // it reaches this point then that strict equality comparison has already failed.\n return typeof a.then !== 'function' && typeof b.then !== 'function' && areObjectsEqual(a, b, state);\n }\n\n // If a URL tag, it should be tested explicitly. Like RegExp, the properties are not\n // enumerable, and therefore will give false positives if tested like a standard object.\n if (tag === URL_TAG) {\n return areUrlsEqual(a, b, state);\n }\n\n // If an error tag, it should be tested explicitly. Like RegExp, the properties are not\n // enumerable, and therefore will give false positives if tested like a standard object.\n if (tag === ERROR_TAG) {\n return areErrorsEqual(a, b, state);\n }\n\n // If an arguments tag, it should be treated as a standard object.\n if (tag === ARGUMENTS_TAG) {\n return areObjectsEqual(a, b, state);\n }\n\n // As the penultimate fallback, check if the values passed are primitive wrappers. This\n // is very rare in modern JS, which is why it is deprioritized compared to all other object\n // types.\n if (tag === BOOLEAN_TAG || tag === NUMBER_TAG || tag === STRING_TAG) {\n return arePrimitiveWrappersEqual(a, b, state);\n }\n\n if (unknownTagComparators) {\n let unknownTagComparator = unknownTagComparators[tag];\n\n if (!unknownTagComparator) {\n const shortTag = getShortTag(a);\n\n if (shortTag) {\n unknownTagComparator = unknownTagComparators[shortTag];\n }\n }\n\n // If the custom config has an unknown tag comparator that matches the captured tag or the\n // @@toStringTag, it is the source of truth for whether the values are equal.\n if (unknownTagComparator) {\n return unknownTagComparator(a, b, state);\n }\n }\n\n // If not matching any tags that require a specific type of comparison, then we hard-code false because\n // the only thing remaining is strict equality, which has already been compared. This is for a few reasons:\n // - Certain types that cannot be introspected (e.g., `WeakMap`). For these types, this is the only\n // comparison that can be made.\n // - For types that can be introspected, but rarely have requirements to be compared\n // (`ArrayBuffer`, `DataView`, etc.), the cost is avoided to prioritize the common\n // use-cases (may be included in a future release, if requested enough).\n // - For types that can be introspected but do not have an objective definition of what\n // equality is (`Error`, etc.), the subjective decision is to be conservative and strictly compare.\n // In all cases, these decisions should be reevaluated based on changes to the language and\n // common development practices.\n return false;\n };\n}\n\n/**\n * Create the configuration object used for building comparators.\n */\nexport function createEqualityComparatorConfig<Meta>({\n circular,\n createCustomConfig,\n strict,\n}: CustomEqualCreatorOptions<Meta>): ComparatorConfig<Meta> {\n let config = {\n areArraysEqual: strict ? areObjectsEqualStrictDefault : areArraysEqualDefault,\n areDatesEqual: areDatesEqualDefault,\n areErrorsEqual: areErrorsEqualDefault,\n areFunctionsEqual: areFunctionsEqualDefault,\n areMapsEqual: strict ? combineComparators(areMapsEqualDefault, areObjectsEqualStrictDefault) : areMapsEqualDefault,\n areNumbersEqual: areNumbersEqualDefault,\n areObjectsEqual: strict ? areObjectsEqualStrictDefault : areObjectsEqualDefault,\n arePrimitiveWrappersEqual: arePrimitiveWrappersEqualDefault,\n areRegExpsEqual: areRegExpsEqualDefault,\n areSetsEqual: strict ? combineComparators(areSetsEqualDefault, areObjectsEqualStrictDefault) : areSetsEqualDefault,\n areTypedArraysEqual: strict ? areObjectsEqualStrictDefault : areTypedArraysEqualDefault,\n areUrlsEqual: areUrlsEqualDefault,\n unknownTagComparators: undefined,\n };\n\n if (createCustomConfig) {\n config = assign({}, config, createCustomConfig(config));\n }\n\n if (circular) {\n const areArraysEqual = createIsCircular(config.areArraysEqual);\n const areMapsEqual = createIsCircular(config.areMapsEqual);\n const areObjectsEqual = createIsCircular(config.areObjectsEqual);\n const areSetsEqual = createIsCircular(config.areSetsEqual);\n\n config = assign({}, config, {\n areArraysEqual,\n areMapsEqual,\n areObjectsEqual,\n areSetsEqual,\n });\n }\n\n return config;\n}\n\n/**\n * Default equality comparator pass-through, used as the standard `isEqual` creator for\n * use inside the built comparator.\n */\nexport function createInternalEqualityComparator<Meta>(\n compare: EqualityComparator<Meta>,\n): InternalEqualityComparator<Meta> {\n return function (\n a: any,\n b: any,\n _indexOrKeyA: any,\n _indexOrKeyB: any,\n _parentA: any,\n _parentB: any,\n state: State<Meta>,\n ) {\n return compare(a, b, state);\n };\n}\n\n/**\n * Create the `isEqual` function used by the consuming application.\n */\nexport function createIsEqual<Meta>({ circular, comparator, createState, equals, strict }: CreateIsEqualOptions<Meta>) {\n if (createState) {\n return function isEqual<A, B>(a: A, b: B): boolean {\n const { cache = circular ? new WeakMap() : undefined, meta } = createState();\n\n return comparator(a, b, {\n cache,\n equals,\n meta,\n strict,\n } as State<Meta>);\n };\n }\n\n if (circular) {\n return function isEqual<A, B>(a: A, b: B): boolean {\n return comparator(a, b, {\n cache: new WeakMap(),\n equals,\n meta: undefined as Meta,\n strict,\n } as State<Meta>);\n };\n }\n\n const state = {\n cache: undefined,\n equals,\n meta: undefined,\n strict,\n } as State<Meta>;\n\n return function isEqual<A, B>(a: A, b: B): boolean {\n return comparator(a, b, state);\n };\n}\n","import {\n createEqualityComparatorConfig,\n createEqualityComparator,\n createInternalEqualityComparator,\n createIsEqual,\n} from './comparator.js';\nimport type { CustomEqualCreatorOptions } from './internalTypes.js';\nimport { sameValueZeroEqual } from './utils.js';\n\nexport { sameValueZeroEqual };\nexport type {\n AnyEqualityComparator,\n Cache,\n CircularState,\n ComparatorConfig,\n CreateCustomComparatorConfig,\n CreateState,\n CustomEqualCreatorOptions,\n DefaultState,\n Dictionary,\n EqualityComparator,\n EqualityComparatorCreator,\n InternalEqualityComparator,\n PrimitiveWrapper,\n State,\n TypeEqualityComparator,\n TypedArray,\n} from './internalTypes.js';\n\n/**\n * Whether the items passed are deeply-equal in value.\n */\nexport const deepEqual = createCustomEqual();\n\n/**\n * Whether the items passed are deeply-equal in value based on strict comparison.\n */\nexport const strictDeepEqual = createCustomEqual({ strict: true });\n\n/**\n * Whether the items passed are deeply-equal in value, including circular references.\n */\nexport const circularDeepEqual = createCustomEqual({ circular: true });\n\n/**\n * Whether the items passed are deeply-equal in value, including circular references,\n * based on strict comparison.\n */\nexport const strictCircularDeepEqual = createCustomEqual({\n circular: true,\n strict: true,\n});\n\n/**\n * Whether the items passed are shallowly-equal in value.\n */\nexport const shallowEqual = createCustomEqual({\n createInternalComparator: () => sameValueZeroEqual,\n});\n\n/**\n * Whether the items passed are shallowly-equal in value based on strict comparison\n */\nexport const strictShallowEqual = createCustomEqual({\n strict: true,\n createInternalComparator: () => sameValueZeroEqual,\n});\n\n/**\n * Whether the items passed are shallowly-equal in value, including circular references.\n */\nexport const circularShallowEqual = createCustomEqual({\n circular: true,\n createInternalComparator: () => sameValueZeroEqual,\n});\n\n/**\n * Whether the items passed are shallowly-equal in value, including circular references,\n * based on strict comparison.\n */\nexport const strictCircularShallowEqual = createCustomEqual({\n circular: true,\n createInternalComparator: () => sameValueZeroEqual,\n strict: true,\n});\n\n/**\n * Create a custom equality comparison method.\n *\n * This can be done to create very targeted comparisons in extreme hot-path scenarios\n * where the standard methods are not performant enough, but can also be used to provide\n * support for legacy environments that do not support expected features like\n * `RegExp.prototype.flags` out of the box.\n */\nexport function createCustomEqual<Meta = undefined>(options: CustomEqualCreatorOptions<Meta> = {}) {\n const {\n circular = false,\n createInternalComparator: createCustomInternalComparator,\n createState,\n strict = false,\n } = options;\n\n const config = createEqualityComparatorConfig<Meta>(options);\n const comparator = createEqualityComparator(config);\n const equals = createCustomInternalComparator\n ? createCustomInternalComparator(comparator)\n : createInternalEqualityComparator(comparator);\n\n return createIsEqual({ circular, comparator, createState, equals, strict });\n}\n"],"names":["areObjectsEqualStrictDefault","areArraysEqualDefault","areDatesEqualDefault","areErrorsEqualDefault","areFunctionsEqualDefault","areMapsEqualDefault","areNumbersEqualDefault","areObjectsEqualDefault","arePrimitiveWrappersEqualDefault","areRegExpsEqualDefault","areSetsEqualDefault","areTypedArraysEqualDefault","areUrlsEqualDefault"],"mappings":"AASA,MAAM,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,GAAG,MAAM;AAC7D;AACA,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,CAAC,SAAS;AAE3C;;AAEG;AACG,SAAU,kBAAkB,CAChC,WAAwC,EACxC,WAAwC,EAAA;AAExC,IAAA,OAAO,SAAS,OAAO,CAAO,CAAI,EAAE,CAAI,EAAE,KAAkB,EAAA;AAC1D,QAAA,OAAO,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,IAAI,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC;AAC7D,IAAA,CAAC;AACH;AAEA;;;;AAIG;AACG,SAAU,gBAAgB,CAC9B,aAA4B,EAAA;AAE5B,IAAA,OAAO,SAAS,UAAU,CAAC,CAAM,E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AAE,IAAI;AACd,IAAA,wBAAwB,EAAE,MAAM,kBAAkB;AAClD,IAAA,MAAM,EAAE,IAAI;AACb,CAAA;AAED;;;;;;;AAOG;AACG,SAAU,iBAAiB,CAAmB,OAAA,GAA2C,EAAE,EAAA;AAC/F,IAAA,MAAM,EACJ,QAAQ,GAAG,KAAK,EAChB,wBAAwB,EAAE,8BAA8B,EACxD,WAAW,EACX,MAAM,GAAG,KAAK,GACf,GAAG,OAAO;AAEX,IAAA,MAAM,MAAM,GAAG,8BAA8B,CAAO,OAAO,CAAC;AAC5D,IAAA,MAAM,UAAU,GAAG,wBAAwB,CAAC,MAAM,CAAC;IACnD,MAAM,MAAM,GAAG;AACb,UAAE,8BAA8B,CAAC,UAAU;AAC3C,UAAE,gCAAgC,CAAC,UAAU,CAAC;AAEhD,IAAA,OAAO,aAAa,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAC7E;;;;"}
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../src/utils.ts","../../../src/equals.ts","../../../src/comparator.ts","../../../src/index.ts"],"sourcesContent":["import type {\n AnyEqualityComparator,\n Cache,\n CircularState,\n Dictionary,\n State,\n TypeEqualityComparator,\n} from './internalTypes.js';\n\nconst { getOwnPropertyNames, getOwnPropertySymbols } = Object;\n// eslint-disable-next-line @typescript-eslint/unbound-method\nconst { hasOwnProperty } = Object.prototype;\n\n/**\n * Combine two comparators into a single comparators.\n */\nexport function combineComparators<Meta>(\n comparatorA: AnyEqualityComparator<Meta>,\n comparatorB: AnyEqualityComparator<Meta>,\n) {\n return function isEqual<A, B>(a: A, b: B, state: State<Meta>) {\n return comparatorA(a, b, state) && comparatorB(a, b, state);\n };\n}\n\n/**\n * Wrap the provided `areItemsEqual` method to manage the circular state, allowing\n * for circular references to be safely included in the comparison without creating\n * stack overflows.\n */\nexport function createIsCircular<AreItemsEqual extends TypeEqualityComparator<any, any>>(\n areItemsEqual: AreItemsEqual,\n): AreItemsEqual {\n return function isCircular(a: any, b: any, state: CircularState<Cache<any, any>>) {\n if (!a || !b || typeof a !== 'object' || typeof b !== 'object') {\n return areItemsEqual(a, b, state);\n }\n\n const { cache } = state;\n\n const cachedA = cache.get(a);\n const cachedB = cache.get(b);\n\n if (cachedA && cachedB) {\n return cachedA === b && cachedB === a;\n }\n\n cache.set(a, b);\n cache.set(b, a);\n\n const result = areItemsEqual(a, b, state);\n\n cache.delete(a);\n cache.delete(b);\n\n return result;\n } as AreItemsEqual;\n}\n\n/**\n * Get the `@@toStringTag` of the value, if it exists.\n */\nexport function getShortTag(value: any): string | undefined {\n return value != null ? (value[Symbol.toStringTag] as string) : undefined;\n}\n\n/**\n * Get the properties to strictly examine, which include both own properties that are\n * not enumerable and symbol properties.\n */\nexport function getStrictProperties(object: Dictionary): Array<string | symbol> {\n return (getOwnPropertyNames(object) as Array<string | symbol>).concat(getOwnPropertySymbols(object));\n}\n\n/**\n * Whether the object contains the property passed as an own property.\n */\nexport const hasOwn =\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n Object.hasOwn || ((object: Dictionary, property: number | string | symbol) => hasOwnProperty.call(object, property));\n\n/**\n * Whether the values passed are strictly equal or both NaN.\n */\nexport function sameValueZeroEqual(a: any, b: any): boolean {\n return a === b || (!a && !b && a !== a && b !== b);\n}\n","import type { Dictionary, PrimitiveWrapper, State, TypedArray } from './internalTypes.js';\nimport { getStrictProperties, hasOwn, sameValueZeroEqual } from './utils.js';\n\nconst PREACT_VNODE = '__v';\nconst PREACT_OWNER = '__o';\nconst REACT_OWNER = '_owner';\n\nconst { getOwnPropertyDescriptor, keys } = Object;\n\n/**\n * Whether the array buffers are equal in value.\n */\nexport function areArrayBuffersEqual(a: ArrayBuffer, b: ArrayBuffer): boolean {\n return a.byteLength === b.byteLength && areTypedArraysEqual(new Uint8Array(a), new Uint8Array(b));\n}\n\n/**\n * Whether the arrays are equal in value.\n */\nexport function areArraysEqual(a: any[], b: any[], state: State<any>) {\n let index = a.length;\n\n if (b.length !== index) {\n return false;\n }\n\n while (index-- > 0) {\n if (!state.equals(a[index], b[index], index, index, a, b, state)) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the dataviews are equal in value.\n */\nexport function areDataViewsEqual(a: DataView, b: DataView): boolean {\n return (\n a.byteLength === b.byteLength\n && areTypedArraysEqual(\n new Uint8Array(a.buffer, a.byteOffset, a.byteLength),\n new Uint8Array(b.buffer, b.byteOffset, b.byteLength),\n )\n );\n}\n\n/**\n * Whether the dates passed are equal in value.\n */\nexport function areDatesEqual(a: Date, b: Date): boolean {\n return sameValueZeroEqual(a.getTime(), b.getTime());\n}\n\n/**\n * Whether the errors passed are equal in value.\n */\nexport function areErrorsEqual(a: Error, b: Error): boolean {\n return a.name === b.name && a.message === b.message && a.cause === b.cause && a.stack === b.stack;\n}\n\n/**\n * Whether the functions passed are equal in value.\n */\nexport function areFunctionsEqual(a: (...args: any[]) => any, b: (...args: any[]) => any): boolean {\n return a === b;\n}\n\n/**\n * Whether the `Map`s are equal in value.\n */\nexport function areMapsEqual(a: Map<any, any>, b: Map<any, any>, state: State<any>): boolean {\n const size = a.size;\n\n if (size !== b.size) {\n return false;\n }\n\n if (!size) {\n return true;\n }\n\n const matchedIndices = new Array<true | undefined>(size);\n const aIterable = a.entries();\n\n let aResult: IteratorResult<[any, any]>;\n let bResult: IteratorResult<[any, any]>;\n let index = 0;\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while ((aResult = aIterable.next())) {\n if (aResult.done) {\n break;\n }\n\n const bIterable = b.entries();\n\n let hasMatch = false;\n let matchIndex = 0;\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while ((bResult = bIterable.next())) {\n if (bResult.done) {\n break;\n }\n\n if (matchedIndices[matchIndex]) {\n matchIndex++;\n continue;\n }\n\n const aEntry = aResult.value;\n const bEntry = bResult.value;\n\n if (\n state.equals(aEntry[0], bEntry[0], index, matchIndex, a, b, state)\n && state.equals(aEntry[1], bEntry[1], aEntry[0], bEntry[0], a, b, state)\n ) {\n hasMatch = matchedIndices[matchIndex] = true;\n break;\n }\n\n matchIndex++;\n }\n\n if (!hasMatch) {\n return false;\n }\n\n index++;\n }\n\n return true;\n}\n\n/**\n * Whether the numbers are equal in value.\n */\nexport const areNumbersEqual = sameValueZeroEqual;\n\n/**\n * Whether the objects are equal in value.\n */\nexport function areObjectsEqual(a: Dictionary, b: Dictionary, state: State<any>): boolean {\n const properties = keys(a);\n\n let index = properties.length;\n\n if (keys(b).length !== index) {\n return false;\n }\n\n // Decrementing `while` showed faster results than either incrementing or\n // decrementing `for` loop and than an incrementing `while` loop. Declarative\n // methods like `some` / `every` were not used to avoid incurring the garbage\n // cost of anonymous callbacks.\n while (index-- > 0) {\n if (!isPropertyEqual(a, b, state, properties[index]!)) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the objects are equal in value with strict property checking.\n */\nexport function areObjectsEqualStrict(a: Dictionary, b: Dictionary, state: State<any>): boolean {\n const properties = getStrictProperties(a);\n\n let index = properties.length;\n\n if (getStrictProperties(b).length !== index) {\n return false;\n }\n\n let property: string | symbol;\n let descriptorA: ReturnType<typeof getOwnPropertyDescriptor>;\n let descriptorB: ReturnType<typeof getOwnPropertyDescriptor>;\n\n // Decrementing `while` showed faster results than either incrementing or\n // decrementing `for` loop and than an incrementing `while` loop. Declarative\n // methods like `some` / `every` were not used to avoid incurring the garbage\n // cost of anonymous callbacks.\n while (index-- > 0) {\n property = properties[index]!;\n\n if (!isPropertyEqual(a, b, state, property)) {\n return false;\n }\n\n descriptorA = getOwnPropertyDescriptor(a, property);\n descriptorB = getOwnPropertyDescriptor(b, property);\n\n if (\n (descriptorA || descriptorB)\n && (!descriptorA\n || !descriptorB\n || descriptorA.configurable !== descriptorB.configurable\n || descriptorA.enumerable !== descriptorB.enumerable\n || descriptorA.writable !== descriptorB.writable)\n ) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the primitive wrappers passed are equal in value.\n */\nexport function arePrimitiveWrappersEqual(a: PrimitiveWrapper, b: PrimitiveWrapper): boolean {\n return sameValueZeroEqual(a.valueOf(), b.valueOf());\n}\n\n/**\n * Whether the regexps passed are equal in value.\n */\nexport function areRegExpsEqual(a: RegExp, b: RegExp): boolean {\n return a.source === b.source && a.flags === b.flags;\n}\n\n/**\n * Whether the `Set`s are equal in value.\n */\nexport function areSetsEqual(a: Set<any>, b: Set<any>, state: State<any>): boolean {\n const size = a.size;\n\n if (size !== b.size) {\n return false;\n }\n\n if (!size) {\n return true;\n }\n\n const matchedIndices = new Array<true | undefined>(size);\n const aIterable = a.values();\n\n let aResult: IteratorResult<any>;\n let bResult: IteratorResult<any>;\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while ((aResult = aIterable.next())) {\n if (aResult.done) {\n break;\n }\n\n const bIterable = b.values();\n\n let hasMatch = false;\n let matchIndex = 0;\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while ((bResult = bIterable.next())) {\n if (bResult.done) {\n break;\n }\n\n if (\n !matchedIndices[matchIndex]\n && state.equals(aResult.value, bResult.value, aResult.value, bResult.value, a, b, state)\n ) {\n hasMatch = matchedIndices[matchIndex] = true;\n break;\n }\n\n matchIndex++;\n }\n\n if (!hasMatch) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the TypedArray instances are equal in value.\n */\nexport function areTypedArraysEqual(a: TypedArray, b: TypedArray) {\n let index = a.byteLength;\n\n if (b.byteLength !== index || a.byteOffset !== b.byteOffset) {\n return false;\n }\n\n while (index-- > 0) {\n if (a[index] !== b[index]) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the URL instances are equal in value.\n */\nexport function areUrlsEqual(a: URL, b: URL): boolean {\n return (\n a.hostname === b.hostname\n && a.pathname === b.pathname\n && a.protocol === b.protocol\n && a.port === b.port\n && a.hash === b.hash\n && a.username === b.username\n && a.password === b.password\n );\n}\n\nfunction isPropertyEqual(a: Dictionary, b: Dictionary, state: State<any>, property: string | symbol) {\n if (\n (property === REACT_OWNER || property === PREACT_OWNER || property === PREACT_VNODE)\n && (a.$$typeof || b.$$typeof)\n ) {\n return true;\n }\n\n return hasOwn(b, property) && state.equals(a[property], b[property], property, property, a, b, state);\n}\n","import {\n areArrayBuffersEqual,\n areArraysEqual as areArraysEqualDefault,\n areDataViewsEqual,\n areDatesEqual as areDatesEqualDefault,\n areErrorsEqual as areErrorsEqualDefault,\n areFunctionsEqual as areFunctionsEqualDefault,\n areMapsEqual as areMapsEqualDefault,\n areNumbersEqual as areNumbersEqualDefault,\n areObjectsEqual as areObjectsEqualDefault,\n areObjectsEqualStrict as areObjectsEqualStrictDefault,\n arePrimitiveWrappersEqual as arePrimitiveWrappersEqualDefault,\n areRegExpsEqual as areRegExpsEqualDefault,\n areSetsEqual as areSetsEqualDefault,\n areTypedArraysEqual as areTypedArraysEqualDefault,\n areUrlsEqual as areUrlsEqualDefault,\n} from './equals.js';\nimport type {\n ComparatorConfig,\n CreateState,\n CustomEqualCreatorOptions,\n EqualityComparator,\n InternalEqualityComparator,\n State,\n} from './internalTypes.js';\nimport { combineComparators, createIsCircular, getShortTag } from './utils.js';\n\nconst ARRAY_BUFFER_TAG = '[object ArrayBuffer]';\nconst ARGUMENTS_TAG = '[object Arguments]';\nconst BOOLEAN_TAG = '[object Boolean]';\nconst DATA_VIEW_TAG = '[object DataView]';\nconst DATE_TAG = '[object Date]';\nconst ERROR_TAG = '[object Error]';\nconst MAP_TAG = '[object Map]';\nconst NUMBER_TAG = '[object Number]';\nconst OBJECT_TAG = '[object Object]';\nconst REG_EXP_TAG = '[object RegExp]';\nconst SET_TAG = '[object Set]';\nconst STRING_TAG = '[object String]';\nconst TYPED_ARRAY_TAGS: Record<string, boolean> = {\n '[object Int8Array]': true,\n '[object Uint8Array]': true,\n '[object Uint8ClampedArray]': true,\n '[object Int16Array]': true,\n '[object Uint16Array]': true,\n '[object Int32Array]': true,\n '[object Uint32Array]': true,\n '[object Float16Array]': true,\n '[object Float32Array]': true,\n '[object Float64Array]': true,\n '[object BigInt64Array]': true,\n '[object BigUint64Array]': true,\n};\nconst URL_TAG = '[object URL]';\n\n// eslint-disable-next-line @typescript-eslint/unbound-method\nconst toString = Object.prototype.toString;\n\ninterface CreateIsEqualOptions<Meta> {\n circular: boolean;\n comparator: EqualityComparator<Meta>;\n createState: CreateState<Meta> | undefined;\n equals: InternalEqualityComparator<Meta>;\n strict: boolean;\n}\n\n/**\n * Create a comparator method based on the type-specific equality comparators passed.\n */\nexport function createEqualityComparator<Meta>({\n areArrayBuffersEqual,\n areArraysEqual,\n areDataViewsEqual,\n areDatesEqual,\n areErrorsEqual,\n areFunctionsEqual,\n areMapsEqual,\n areNumbersEqual,\n areObjectsEqual,\n arePrimitiveWrappersEqual,\n areRegExpsEqual,\n areSetsEqual,\n areTypedArraysEqual,\n areUrlsEqual,\n unknownTagComparators,\n}: ComparatorConfig<Meta>): EqualityComparator<Meta> {\n /**\n * compare the value of the two objects and return true if they are equivalent in values\n */\n return function comparator(a: any, b: any, state: State<Meta>): boolean {\n // If the items are strictly equal, no need to do a value comparison.\n if (a === b) {\n return true;\n }\n\n // If either of the items are nullish and fail the strictly equal check\n // above, then they must be unequal.\n if (a == null || b == null) {\n return false;\n }\n\n const type = typeof a;\n\n if (type !== typeof b) {\n return false;\n }\n\n if (type !== 'object') {\n if (type === 'number') {\n return areNumbersEqual(a, b, state);\n }\n\n if (type === 'function') {\n return areFunctionsEqual(a, b, state);\n }\n\n // If a primitive value that is not strictly equal, it must be unequal.\n return false;\n }\n\n const constructor = a.constructor;\n\n // Checks are listed in order of commonality of use-case:\n // 1. Common complex object types (plain object, array)\n // 2. Common data values (date, regexp)\n // 3. Less-common complex object types (map, set)\n // 4. Less-common data values (promise, primitive wrappers)\n // Inherently this is both subjective and assumptive, however\n // when reviewing comparable libraries in the wild this order\n // appears to be generally consistent.\n\n // Constructors should match, otherwise there is potential for false positives\n // between class and subclass or custom object and POJO.\n if (constructor !== b.constructor) {\n return false;\n }\n\n // `isPlainObject` only checks against the object's own realm. Cross-realm\n // comparisons are rare, and will be handled in the ultimate fallback, so\n // we can avoid capturing the string tag.\n if (constructor === Object) {\n return areObjectsEqual(a, b, state);\n }\n\n // `isArray()` works on subclasses and is cross-realm, so we can avoid capturing\n // the string tag or doing an `instanceof` check.\n if (Array.isArray(a)) {\n return areArraysEqual(a, b, state);\n }\n\n // Try to fast-path equality checks for other complex object types in the\n // same realm to avoid capturing the string tag. Strict equality is used\n // instead of `instanceof` because it is more performant for the common\n // use-case. If someone is subclassing a native class, it will be handled\n // with the string tag comparison.\n\n if (constructor === Date) {\n return areDatesEqual(a, b, state);\n }\n\n if (constructor === RegExp) {\n return areRegExpsEqual(a, b, state);\n }\n\n if (constructor === Map) {\n return areMapsEqual(a, b, state);\n }\n\n if (constructor === Set) {\n return areSetsEqual(a, b, state);\n }\n\n // Since this is a custom object, capture the string tag to determing its type.\n // This is reasonably performant in modern environments like v8 and SpiderMonkey.\n const tag = toString.call(a);\n\n if (tag === DATE_TAG) {\n return areDatesEqual(a, b, state);\n }\n\n // For RegExp, the properties are not enumerable, and therefore will give false positives if\n // tested like a standard object.\n if (tag === REG_EXP_TAG) {\n return areRegExpsEqual(a, b, state);\n }\n\n if (tag === MAP_TAG) {\n return areMapsEqual(a, b, state);\n }\n\n if (tag === SET_TAG) {\n return areSetsEqual(a, b, state);\n }\n\n if (tag === OBJECT_TAG) {\n // The exception for value comparison is custom `Promise`-like class instances. These should\n // be treated the same as standard `Promise` objects, which means strict equality, and if\n // it reaches this point then that strict equality comparison has already failed.\n return typeof a.then !== 'function' && typeof b.then !== 'function' && areObjectsEqual(a, b, state);\n }\n\n // If a URL tag, it should be tested explicitly. Like RegExp, the properties are not\n // enumerable, and therefore will give false positives if tested like a standard object.\n if (tag === URL_TAG) {\n return areUrlsEqual(a, b, state);\n }\n\n // If an error tag, it should be tested explicitly. Like RegExp, the properties are not\n // enumerable, and therefore will give false positives if tested like a standard object.\n if (tag === ERROR_TAG) {\n return areErrorsEqual(a, b, state);\n }\n\n // If an arguments tag, it should be treated as a standard object.\n if (tag === ARGUMENTS_TAG) {\n return areObjectsEqual(a, b, state);\n }\n\n if (TYPED_ARRAY_TAGS[tag]) {\n return areTypedArraysEqual(a, b, state);\n }\n\n if (tag === ARRAY_BUFFER_TAG) {\n return areArrayBuffersEqual(a, b, state);\n }\n\n if (tag === DATA_VIEW_TAG) {\n return areDataViewsEqual(a, b, state);\n }\n\n // As the penultimate fallback, check if the values passed are primitive wrappers. This\n // is very rare in modern JS, which is why it is deprioritized compared to all other object\n // types.\n if (tag === BOOLEAN_TAG || tag === NUMBER_TAG || tag === STRING_TAG) {\n return arePrimitiveWrappersEqual(a, b, state);\n }\n\n if (unknownTagComparators) {\n let unknownTagComparator = unknownTagComparators[tag];\n\n if (!unknownTagComparator) {\n const shortTag = getShortTag(a);\n\n if (shortTag) {\n unknownTagComparator = unknownTagComparators[shortTag];\n }\n }\n\n // If the custom config has an unknown tag comparator that matches the captured tag or the\n // @@toStringTag, it is the source of truth for whether the values are equal.\n if (unknownTagComparator) {\n return unknownTagComparator(a, b, state);\n }\n }\n\n // If not matching any tags that require a specific type of comparison, then we hard-code false because\n // the only thing remaining is strict equality, which has already been compared. This is for a few reasons:\n // - Certain types that cannot be introspected (e.g., `WeakMap`). For these types, this is the only\n // comparison that can be made.\n // - For types that can be introspected, but rarely have requirements to be compared\n // (`ArrayBuffer`, `DataView`, etc.), the cost is avoided to prioritize the common\n // use-cases (may be included in a future release, if requested enough).\n // - For types that can be introspected but do not have an objective definition of what\n // equality is (`Error`, etc.), the subjective decision is to be conservative and strictly compare.\n // In all cases, these decisions should be reevaluated based on changes to the language and\n // common development practices.\n return false;\n };\n}\n\n/**\n * Create the configuration object used for building comparators.\n */\nexport function createEqualityComparatorConfig<Meta>({\n circular,\n createCustomConfig,\n strict,\n}: CustomEqualCreatorOptions<Meta>): ComparatorConfig<Meta> {\n let config = {\n areArrayBuffersEqual,\n areArraysEqual: strict ? areObjectsEqualStrictDefault : areArraysEqualDefault,\n areDataViewsEqual,\n areDatesEqual: areDatesEqualDefault,\n areErrorsEqual: areErrorsEqualDefault,\n areFunctionsEqual: areFunctionsEqualDefault,\n areMapsEqual: strict ? combineComparators(areMapsEqualDefault, areObjectsEqualStrictDefault) : areMapsEqualDefault,\n areNumbersEqual: areNumbersEqualDefault,\n areObjectsEqual: strict ? areObjectsEqualStrictDefault : areObjectsEqualDefault,\n arePrimitiveWrappersEqual: arePrimitiveWrappersEqualDefault,\n areRegExpsEqual: areRegExpsEqualDefault,\n areSetsEqual: strict ? combineComparators(areSetsEqualDefault, areObjectsEqualStrictDefault) : areSetsEqualDefault,\n areTypedArraysEqual: strict\n ? combineComparators(areTypedArraysEqualDefault, areObjectsEqualStrictDefault)\n : areTypedArraysEqualDefault,\n areUrlsEqual: areUrlsEqualDefault,\n unknownTagComparators: undefined,\n };\n\n if (createCustomConfig) {\n config = Object.assign({}, config, createCustomConfig(config));\n }\n\n if (circular) {\n const areArraysEqual = createIsCircular(config.areArraysEqual);\n const areMapsEqual = createIsCircular(config.areMapsEqual);\n const areObjectsEqual = createIsCircular(config.areObjectsEqual);\n const areSetsEqual = createIsCircular(config.areSetsEqual);\n\n config = Object.assign({}, config, {\n areArraysEqual,\n areMapsEqual,\n areObjectsEqual,\n areSetsEqual,\n });\n }\n\n return config;\n}\n\n/**\n * Default equality comparator pass-through, used as the standard `isEqual` creator for\n * use inside the built comparator.\n */\nexport function createInternalEqualityComparator<Meta>(\n compare: EqualityComparator<Meta>,\n): InternalEqualityComparator<Meta> {\n return function (\n a: any,\n b: any,\n _indexOrKeyA: any,\n _indexOrKeyB: any,\n _parentA: any,\n _parentB: any,\n state: State<Meta>,\n ) {\n return compare(a, b, state);\n };\n}\n\n/**\n * Create the `isEqual` function used by the consuming application.\n */\nexport function createIsEqual<Meta>({ circular, comparator, createState, equals, strict }: CreateIsEqualOptions<Meta>) {\n if (createState) {\n return function isEqual<A, B>(a: A, b: B): boolean {\n const { cache = circular ? new WeakMap() : undefined, meta } = createState();\n\n return comparator(a, b, {\n cache,\n equals,\n meta,\n strict,\n } as State<Meta>);\n };\n }\n\n if (circular) {\n return function isEqual<A, B>(a: A, b: B): boolean {\n return comparator(a, b, {\n cache: new WeakMap(),\n equals,\n meta: undefined as Meta,\n strict,\n } as State<Meta>);\n };\n }\n\n const state = {\n cache: undefined,\n equals,\n meta: undefined,\n strict,\n } as State<Meta>;\n\n return function isEqual<A, B>(a: A, b: B): boolean {\n return comparator(a, b, state);\n };\n}\n","import {\n createEqualityComparatorConfig,\n createEqualityComparator,\n createInternalEqualityComparator,\n createIsEqual,\n} from './comparator.js';\nimport type { CustomEqualCreatorOptions } from './internalTypes.js';\nimport { sameValueZeroEqual } from './utils.js';\n\nexport { sameValueZeroEqual };\nexport type {\n AnyEqualityComparator,\n Cache,\n CircularState,\n ComparatorConfig,\n CreateCustomComparatorConfig,\n CreateState,\n CustomEqualCreatorOptions,\n DefaultState,\n Dictionary,\n EqualityComparator,\n EqualityComparatorCreator,\n InternalEqualityComparator,\n PrimitiveWrapper,\n State,\n TypeEqualityComparator,\n TypedArray,\n} from './internalTypes.js';\n\n/**\n * Whether the items passed are deeply-equal in value.\n */\nexport const deepEqual = createCustomEqual();\n\n/**\n * Whether the items passed are deeply-equal in value based on strict comparison.\n */\nexport const strictDeepEqual = createCustomEqual({ strict: true });\n\n/**\n * Whether the items passed are deeply-equal in value, including circular references.\n */\nexport const circularDeepEqual = createCustomEqual({ circular: true });\n\n/**\n * Whether the items passed are deeply-equal in value, including circular references,\n * based on strict comparison.\n */\nexport const strictCircularDeepEqual = createCustomEqual({\n circular: true,\n strict: true,\n});\n\n/**\n * Whether the items passed are shallowly-equal in value.\n */\nexport const shallowEqual = createCustomEqual({\n createInternalComparator: () => sameValueZeroEqual,\n});\n\n/**\n * Whether the items passed are shallowly-equal in value based on strict comparison\n */\nexport const strictShallowEqual = createCustomEqual({\n strict: true,\n createInternalComparator: () => sameValueZeroEqual,\n});\n\n/**\n * Whether the items passed are shallowly-equal in value, including circular references.\n */\nexport const circularShallowEqual = createCustomEqual({\n circular: true,\n createInternalComparator: () => sameValueZeroEqual,\n});\n\n/**\n * Whether the items passed are shallowly-equal in value, including circular references,\n * based on strict comparison.\n */\nexport const strictCircularShallowEqual = createCustomEqual({\n circular: true,\n createInternalComparator: () => sameValueZeroEqual,\n strict: true,\n});\n\n/**\n * Create a custom equality comparison method.\n *\n * This can be done to create very targeted comparisons in extreme hot-path scenarios\n * where the standard methods are not performant enough, but can also be used to provide\n * support for legacy environments that do not support expected features like\n * `RegExp.prototype.flags` out of the box.\n */\nexport function createCustomEqual<Meta = undefined>(options: CustomEqualCreatorOptions<Meta> = {}) {\n const {\n circular = false,\n createInternalComparator: createCustomInternalComparator,\n createState,\n strict = false,\n } = options;\n\n const config = createEqualityComparatorConfig<Meta>(options);\n const comparator = createEqualityComparator(config);\n const equals = createCustomInternalComparator\n ? createCustomInternalComparator(comparator)\n : createInternalEqualityComparator(comparator);\n\n return createIsEqual({ circular, comparator, createState, equals, strict });\n}\n"],"names":["areObjectsEqualStrictDefault","areArraysEqualDefault","areDatesEqualDefault","areErrorsEqualDefault","areFunctionsEqualDefault","areMapsEqualDefault","areNumbersEqualDefault","areObjectsEqualDefault","arePrimitiveWrappersEqualDefault","areRegExpsEqualDefault","areSetsEqualDefault","areTypedArraysEqualDefault","areUrlsEqualDefault"],"mappings":"AASA,MAAM,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,GAAG,MAAM;AAC7D;AACA,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,CAAC,SAAS;AAE3C;;AAEG;AACG,SAAU,kBAAkB,CAChC,WAAwC,EACxC,WAAwC,EAAA;AAExC,IAAA,OAAO,SAAS,OAAO,CAAO,CAAI,EAAE,CAAI,EAAE,KAAkB,EAAA;AAC1D,QAAA,OAAO,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,IAA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wB,EAAE,MAAM,kBAAkB;AACnD,CAAA;AAED;;;AAGG;AACI,MAAM,0BAA0B,GAAG,iBAAiB,CAAC;AAC1D,IAAA,QAAQ,EAAE,IAAI;AACd,IAAA,wBAAwB,EAAE,MAAM,kBAAkB;AAClD,IAAA,MAAM,EAAE,IAAI;AACb,CAAA;AAED;;;;;;;AAOG;AACG,SAAU,iBAAiB,CAAmB,OAAA,GAA2C,EAAE,EAAA;AAC/F,IAAA,MAAM,EACJ,QAAQ,GAAG,KAAK,EAChB,wBAAwB,EAAE,8BAA8B,EACxD,WAAW,EACX,MAAM,GAAG,KAAK,GACf,GAAG,OAAO;AAEX,IAAA,MAAM,MAAM,GAAG,8BAA8B,CAAO,OAAO,CAAC;AAC5D,IAAA,MAAM,UAAU,GAAG,wBAAwB,CAAC,MAAM,CAAC;IACnD,MAAM,MAAM,GAAG;AACb,UAAE,8BAA8B,CAAC,UAAU;AAC3C,UAAE,gCAAgC,CAAC,UAAU,CAAC;AAEhD,IAAA,OAAO,aAAa,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAC7E;;;;"}
|
|
@@ -38,11 +38,20 @@ export interface Dictionary<Value = any> {
|
|
|
38
38
|
$$typeof?: any;
|
|
39
39
|
}
|
|
40
40
|
export interface ComparatorConfig<Meta> {
|
|
41
|
+
/**
|
|
42
|
+
* Whether the array buffers passed are equal in value. In strict mode, this includes
|
|
43
|
+
* additional properties added to the array.
|
|
44
|
+
*/
|
|
45
|
+
areArrayBuffersEqual: TypeEqualityComparator<any, Meta>;
|
|
41
46
|
/**
|
|
42
47
|
* Whether the arrays passed are equal in value. In strict mode, this includes
|
|
43
48
|
* additional properties added to the array.
|
|
44
49
|
*/
|
|
45
50
|
areArraysEqual: TypeEqualityComparator<any, Meta>;
|
|
51
|
+
/**
|
|
52
|
+
* Whether the data views passed are equal in value.
|
|
53
|
+
*/
|
|
54
|
+
areDataViewsEqual: TypeEqualityComparator<any, Meta>;
|
|
46
55
|
/**
|
|
47
56
|
* Whether the dates passed are equal in value.
|
|
48
57
|
*/
|
|
@@ -120,15 +129,10 @@ export type PrimitiveWrapper = Boolean | Number | String;
|
|
|
120
129
|
/**
|
|
121
130
|
* Type which encompasses possible instances of TypedArray
|
|
122
131
|
* classes.
|
|
123
|
-
*
|
|
124
|
-
* **NOTE**: This does not include `BigInt64Array` and
|
|
125
|
-
* `BitUint64Array` because those are part of ES2020 and
|
|
126
|
-
* not supported by certain TS configurations. If using
|
|
127
|
-
* either in `areTypedArraysEqual`, you can cast the
|
|
128
|
-
* instance as `TypedArray` and it will work as expected,
|
|
129
|
-
* because runtime checks will still work for those classes.
|
|
130
132
|
*/
|
|
131
133
|
export type TypedArray =
|
|
134
|
+
| BigInt64Array
|
|
135
|
+
| BigUint64Array
|
|
132
136
|
| Float32Array
|
|
133
137
|
| Float64Array
|
|
134
138
|
| Int8Array
|
package/dist/umd/comparator.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ interface CreateIsEqualOptions<Meta> {
|
|
|
9
9
|
/**
|
|
10
10
|
* Create a comparator method based on the type-specific equality comparators passed.
|
|
11
11
|
*/
|
|
12
|
-
export declare function createEqualityComparator<Meta>({ areArraysEqual, areDatesEqual, areErrorsEqual, areFunctionsEqual, areMapsEqual, areNumbersEqual, areObjectsEqual, arePrimitiveWrappersEqual, areRegExpsEqual, areSetsEqual, areTypedArraysEqual, areUrlsEqual, unknownTagComparators, }: ComparatorConfig<Meta>): EqualityComparator<Meta>;
|
|
12
|
+
export declare function createEqualityComparator<Meta>({ areArrayBuffersEqual, areArraysEqual, areDataViewsEqual, areDatesEqual, areErrorsEqual, areFunctionsEqual, areMapsEqual, areNumbersEqual, areObjectsEqual, arePrimitiveWrappersEqual, areRegExpsEqual, areSetsEqual, areTypedArraysEqual, areUrlsEqual, unknownTagComparators, }: ComparatorConfig<Meta>): EqualityComparator<Meta>;
|
|
13
13
|
/**
|
|
14
14
|
* Create the configuration object used for building comparators.
|
|
15
15
|
*/
|
package/dist/umd/equals.d.ts
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import type { Dictionary, PrimitiveWrapper, State, TypedArray } from './internalTypes.js';
|
|
2
2
|
import { sameValueZeroEqual } from './utils.js';
|
|
3
|
+
/**
|
|
4
|
+
* Whether the array buffers are equal in value.
|
|
5
|
+
*/
|
|
6
|
+
export declare function areArrayBuffersEqual(a: ArrayBuffer, b: ArrayBuffer): boolean;
|
|
3
7
|
/**
|
|
4
8
|
* Whether the arrays are equal in value.
|
|
5
9
|
*/
|
|
6
10
|
export declare function areArraysEqual(a: any[], b: any[], state: State<any>): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Whether the dataviews are equal in value.
|
|
13
|
+
*/
|
|
14
|
+
export declare function areDataViewsEqual(a: DataView, b: DataView): boolean;
|
|
7
15
|
/**
|
|
8
16
|
* Whether the dates passed are equal in value.
|
|
9
17
|
*/
|
package/dist/umd/index.js
CHANGED
|
@@ -69,6 +69,12 @@
|
|
|
69
69
|
const PREACT_OWNER = '__o';
|
|
70
70
|
const REACT_OWNER = '_owner';
|
|
71
71
|
const { getOwnPropertyDescriptor, keys } = Object;
|
|
72
|
+
/**
|
|
73
|
+
* Whether the array buffers are equal in value.
|
|
74
|
+
*/
|
|
75
|
+
function areArrayBuffersEqual(a, b) {
|
|
76
|
+
return a.byteLength === b.byteLength && areTypedArraysEqual(new Uint8Array(a), new Uint8Array(b));
|
|
77
|
+
}
|
|
72
78
|
/**
|
|
73
79
|
* Whether the arrays are equal in value.
|
|
74
80
|
*/
|
|
@@ -84,6 +90,13 @@
|
|
|
84
90
|
}
|
|
85
91
|
return true;
|
|
86
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* Whether the dataviews are equal in value.
|
|
95
|
+
*/
|
|
96
|
+
function areDataViewsEqual(a, b) {
|
|
97
|
+
return (a.byteLength === b.byteLength
|
|
98
|
+
&& areTypedArraysEqual(new Uint8Array(a.buffer, a.byteOffset, a.byteLength), new Uint8Array(b.buffer, b.byteOffset, b.byteLength)));
|
|
99
|
+
}
|
|
87
100
|
/**
|
|
88
101
|
* Whether the dates passed are equal in value.
|
|
89
102
|
*/
|
|
@@ -266,8 +279,8 @@
|
|
|
266
279
|
* Whether the TypedArray instances are equal in value.
|
|
267
280
|
*/
|
|
268
281
|
function areTypedArraysEqual(a, b) {
|
|
269
|
-
let index = a.
|
|
270
|
-
if (b.
|
|
282
|
+
let index = a.byteLength;
|
|
283
|
+
if (b.byteLength !== index || a.byteOffset !== b.byteOffset) {
|
|
271
284
|
return false;
|
|
272
285
|
}
|
|
273
286
|
while (index-- > 0) {
|
|
@@ -297,8 +310,10 @@
|
|
|
297
310
|
return hasOwn(b, property) && state.equals(a[property], b[property], property, property, a, b, state);
|
|
298
311
|
}
|
|
299
312
|
|
|
313
|
+
const ARRAY_BUFFER_TAG = '[object ArrayBuffer]';
|
|
300
314
|
const ARGUMENTS_TAG = '[object Arguments]';
|
|
301
315
|
const BOOLEAN_TAG = '[object Boolean]';
|
|
316
|
+
const DATA_VIEW_TAG = '[object DataView]';
|
|
302
317
|
const DATE_TAG = '[object Date]';
|
|
303
318
|
const ERROR_TAG = '[object Error]';
|
|
304
319
|
const MAP_TAG = '[object Map]';
|
|
@@ -307,18 +322,27 @@
|
|
|
307
322
|
const REG_EXP_TAG = '[object RegExp]';
|
|
308
323
|
const SET_TAG = '[object Set]';
|
|
309
324
|
const STRING_TAG = '[object String]';
|
|
325
|
+
const TYPED_ARRAY_TAGS = {
|
|
326
|
+
'[object Int8Array]': true,
|
|
327
|
+
'[object Uint8Array]': true,
|
|
328
|
+
'[object Uint8ClampedArray]': true,
|
|
329
|
+
'[object Int16Array]': true,
|
|
330
|
+
'[object Uint16Array]': true,
|
|
331
|
+
'[object Int32Array]': true,
|
|
332
|
+
'[object Uint32Array]': true,
|
|
333
|
+
'[object Float16Array]': true,
|
|
334
|
+
'[object Float32Array]': true,
|
|
335
|
+
'[object Float64Array]': true,
|
|
336
|
+
'[object BigInt64Array]': true,
|
|
337
|
+
'[object BigUint64Array]': true,
|
|
338
|
+
};
|
|
310
339
|
const URL_TAG = '[object URL]';
|
|
311
|
-
const { isArray } = Array;
|
|
312
|
-
const isTypedArray =
|
|
313
340
|
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
314
|
-
|
|
315
|
-
const { assign } = Object;
|
|
316
|
-
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
317
|
-
const getTag = Object.prototype.toString.call.bind(Object.prototype.toString);
|
|
341
|
+
const toString = Object.prototype.toString;
|
|
318
342
|
/**
|
|
319
343
|
* Create a comparator method based on the type-specific equality comparators passed.
|
|
320
344
|
*/
|
|
321
|
-
function createEqualityComparator({ areArraysEqual, areDatesEqual, areErrorsEqual, areFunctionsEqual, areMapsEqual, areNumbersEqual, areObjectsEqual, arePrimitiveWrappersEqual, areRegExpsEqual, areSetsEqual, areTypedArraysEqual, areUrlsEqual, unknownTagComparators, }) {
|
|
345
|
+
function createEqualityComparator({ areArrayBuffersEqual, areArraysEqual, areDataViewsEqual, areDatesEqual, areErrorsEqual, areFunctionsEqual, areMapsEqual, areNumbersEqual, areObjectsEqual, arePrimitiveWrappersEqual, areRegExpsEqual, areSetsEqual, areTypedArraysEqual, areUrlsEqual, unknownTagComparators, }) {
|
|
322
346
|
/**
|
|
323
347
|
* compare the value of the two objects and return true if they are equivalent in values
|
|
324
348
|
*/
|
|
@@ -368,14 +392,9 @@
|
|
|
368
392
|
}
|
|
369
393
|
// `isArray()` works on subclasses and is cross-realm, so we can avoid capturing
|
|
370
394
|
// the string tag or doing an `instanceof` check.
|
|
371
|
-
if (isArray(a)) {
|
|
395
|
+
if (Array.isArray(a)) {
|
|
372
396
|
return areArraysEqual(a, b, state);
|
|
373
397
|
}
|
|
374
|
-
// `isTypedArray()` works on all possible TypedArray classes, so we can avoid
|
|
375
|
-
// capturing the string tag or comparing against all possible constructors.
|
|
376
|
-
if (isTypedArray != null && isTypedArray(a)) {
|
|
377
|
-
return areTypedArraysEqual(a, b, state);
|
|
378
|
-
}
|
|
379
398
|
// Try to fast-path equality checks for other complex object types in the
|
|
380
399
|
// same realm to avoid capturing the string tag. Strict equality is used
|
|
381
400
|
// instead of `instanceof` because it is more performant for the common
|
|
@@ -395,7 +414,7 @@
|
|
|
395
414
|
}
|
|
396
415
|
// Since this is a custom object, capture the string tag to determing its type.
|
|
397
416
|
// This is reasonably performant in modern environments like v8 and SpiderMonkey.
|
|
398
|
-
const tag =
|
|
417
|
+
const tag = toString.call(a);
|
|
399
418
|
if (tag === DATE_TAG) {
|
|
400
419
|
return areDatesEqual(a, b, state);
|
|
401
420
|
}
|
|
@@ -430,6 +449,15 @@
|
|
|
430
449
|
if (tag === ARGUMENTS_TAG) {
|
|
431
450
|
return areObjectsEqual(a, b, state);
|
|
432
451
|
}
|
|
452
|
+
if (TYPED_ARRAY_TAGS[tag]) {
|
|
453
|
+
return areTypedArraysEqual(a, b, state);
|
|
454
|
+
}
|
|
455
|
+
if (tag === ARRAY_BUFFER_TAG) {
|
|
456
|
+
return areArrayBuffersEqual(a, b, state);
|
|
457
|
+
}
|
|
458
|
+
if (tag === DATA_VIEW_TAG) {
|
|
459
|
+
return areDataViewsEqual(a, b, state);
|
|
460
|
+
}
|
|
433
461
|
// As the penultimate fallback, check if the values passed are primitive wrappers. This
|
|
434
462
|
// is very rare in modern JS, which is why it is deprioritized compared to all other object
|
|
435
463
|
// types.
|
|
@@ -469,7 +497,9 @@
|
|
|
469
497
|
*/
|
|
470
498
|
function createEqualityComparatorConfig({ circular, createCustomConfig, strict, }) {
|
|
471
499
|
let config = {
|
|
500
|
+
areArrayBuffersEqual,
|
|
472
501
|
areArraysEqual: strict ? areObjectsEqualStrict : areArraysEqual,
|
|
502
|
+
areDataViewsEqual,
|
|
473
503
|
areDatesEqual: areDatesEqual,
|
|
474
504
|
areErrorsEqual: areErrorsEqual,
|
|
475
505
|
areFunctionsEqual: areFunctionsEqual,
|
|
@@ -479,19 +509,21 @@
|
|
|
479
509
|
arePrimitiveWrappersEqual: arePrimitiveWrappersEqual,
|
|
480
510
|
areRegExpsEqual: areRegExpsEqual,
|
|
481
511
|
areSetsEqual: strict ? combineComparators(areSetsEqual, areObjectsEqualStrict) : areSetsEqual,
|
|
482
|
-
areTypedArraysEqual: strict
|
|
512
|
+
areTypedArraysEqual: strict
|
|
513
|
+
? combineComparators(areTypedArraysEqual, areObjectsEqualStrict)
|
|
514
|
+
: areTypedArraysEqual,
|
|
483
515
|
areUrlsEqual: areUrlsEqual,
|
|
484
516
|
unknownTagComparators: undefined,
|
|
485
517
|
};
|
|
486
518
|
if (createCustomConfig) {
|
|
487
|
-
config = assign({}, config, createCustomConfig(config));
|
|
519
|
+
config = Object.assign({}, config, createCustomConfig(config));
|
|
488
520
|
}
|
|
489
521
|
if (circular) {
|
|
490
522
|
const areArraysEqual = createIsCircular(config.areArraysEqual);
|
|
491
523
|
const areMapsEqual = createIsCircular(config.areMapsEqual);
|
|
492
524
|
const areObjectsEqual = createIsCircular(config.areObjectsEqual);
|
|
493
525
|
const areSetsEqual = createIsCircular(config.areSetsEqual);
|
|
494
|
-
config = assign({}, config, {
|
|
526
|
+
config = Object.assign({}, config, {
|
|
495
527
|
areArraysEqual,
|
|
496
528
|
areMapsEqual,
|
|
497
529
|
areObjectsEqual,
|