fast-equals 5.4.0 → 6.0.0-beta.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/dist/umd/index.js DELETED
@@ -1,659 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3
- typeof define === 'function' && define.amd ? define(['exports'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["fast-equals"] = {}));
5
- })(this, (function (exports) { 'use strict';
6
-
7
- const { getOwnPropertyNames, getOwnPropertySymbols } = Object;
8
- // eslint-disable-next-line @typescript-eslint/unbound-method
9
- const { hasOwnProperty } = Object.prototype;
10
- /**
11
- * Combine two comparators into a single comparators.
12
- */
13
- function combineComparators(comparatorA, comparatorB) {
14
- return function isEqual(a, b, state) {
15
- return comparatorA(a, b, state) && comparatorB(a, b, state);
16
- };
17
- }
18
- /**
19
- * Wrap the provided `areItemsEqual` method to manage the circular state, allowing
20
- * for circular references to be safely included in the comparison without creating
21
- * stack overflows.
22
- */
23
- function createIsCircular(areItemsEqual) {
24
- return function isCircular(a, b, state) {
25
- if (!a || !b || typeof a !== 'object' || typeof b !== 'object') {
26
- return areItemsEqual(a, b, state);
27
- }
28
- const { cache } = state;
29
- const cachedA = cache.get(a);
30
- const cachedB = cache.get(b);
31
- if (cachedA && cachedB) {
32
- return cachedA === b && cachedB === a;
33
- }
34
- cache.set(a, b);
35
- cache.set(b, a);
36
- const result = areItemsEqual(a, b, state);
37
- cache.delete(a);
38
- cache.delete(b);
39
- return result;
40
- };
41
- }
42
- /**
43
- * Get the `@@toStringTag` of the value, if it exists.
44
- */
45
- function getShortTag(value) {
46
- return value != null ? value[Symbol.toStringTag] : undefined;
47
- }
48
- /**
49
- * Get the properties to strictly examine, which include both own properties that are
50
- * not enumerable and symbol properties.
51
- */
52
- function getStrictProperties(object) {
53
- return getOwnPropertyNames(object).concat(getOwnPropertySymbols(object));
54
- }
55
- /**
56
- * Whether the object contains the property passed as an own property.
57
- */
58
- const hasOwn =
59
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
60
- Object.hasOwn || ((object, property) => hasOwnProperty.call(object, property));
61
- /**
62
- * Whether the values passed are strictly equal or both NaN.
63
- */
64
- function sameValueZeroEqual(a, b) {
65
- return a === b || (!a && !b && a !== a && b !== b);
66
- }
67
-
68
- const PREACT_VNODE = '__v';
69
- const PREACT_OWNER = '__o';
70
- const REACT_OWNER = '_owner';
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
- }
78
- /**
79
- * Whether the arrays are equal in value.
80
- */
81
- function areArraysEqual(a, b, state) {
82
- let index = a.length;
83
- if (b.length !== index) {
84
- return false;
85
- }
86
- while (index-- > 0) {
87
- if (!state.equals(a[index], b[index], index, index, a, b, state)) {
88
- return false;
89
- }
90
- }
91
- return true;
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
- }
100
- /**
101
- * Whether the dates passed are equal in value.
102
- */
103
- function areDatesEqual(a, b) {
104
- return sameValueZeroEqual(a.getTime(), b.getTime());
105
- }
106
- /**
107
- * Whether the errors passed are equal in value.
108
- */
109
- function areErrorsEqual(a, b) {
110
- return a.name === b.name && a.message === b.message && a.cause === b.cause && a.stack === b.stack;
111
- }
112
- /**
113
- * Whether the functions passed are equal in value.
114
- */
115
- function areFunctionsEqual(a, b) {
116
- return a === b;
117
- }
118
- /**
119
- * Whether the `Map`s are equal in value.
120
- */
121
- function areMapsEqual(a, b, state) {
122
- const size = a.size;
123
- if (size !== b.size) {
124
- return false;
125
- }
126
- if (!size) {
127
- return true;
128
- }
129
- const matchedIndices = new Array(size);
130
- const aIterable = a.entries();
131
- let aResult;
132
- let bResult;
133
- let index = 0;
134
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
135
- while ((aResult = aIterable.next())) {
136
- if (aResult.done) {
137
- break;
138
- }
139
- const bIterable = b.entries();
140
- let hasMatch = false;
141
- let matchIndex = 0;
142
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
143
- while ((bResult = bIterable.next())) {
144
- if (bResult.done) {
145
- break;
146
- }
147
- if (matchedIndices[matchIndex]) {
148
- matchIndex++;
149
- continue;
150
- }
151
- const aEntry = aResult.value;
152
- const bEntry = bResult.value;
153
- if (state.equals(aEntry[0], bEntry[0], index, matchIndex, a, b, state)
154
- && state.equals(aEntry[1], bEntry[1], aEntry[0], bEntry[0], a, b, state)) {
155
- hasMatch = matchedIndices[matchIndex] = true;
156
- break;
157
- }
158
- matchIndex++;
159
- }
160
- if (!hasMatch) {
161
- return false;
162
- }
163
- index++;
164
- }
165
- return true;
166
- }
167
- /**
168
- * Whether the numbers are equal in value.
169
- */
170
- const areNumbersEqual = sameValueZeroEqual;
171
- /**
172
- * Whether the objects are equal in value.
173
- */
174
- function areObjectsEqual(a, b, state) {
175
- const properties = keys(a);
176
- let index = properties.length;
177
- if (keys(b).length !== index) {
178
- return false;
179
- }
180
- // Decrementing `while` showed faster results than either incrementing or
181
- // decrementing `for` loop and than an incrementing `while` loop. Declarative
182
- // methods like `some` / `every` were not used to avoid incurring the garbage
183
- // cost of anonymous callbacks.
184
- while (index-- > 0) {
185
- if (!isPropertyEqual(a, b, state, properties[index])) {
186
- return false;
187
- }
188
- }
189
- return true;
190
- }
191
- /**
192
- * Whether the objects are equal in value with strict property checking.
193
- */
194
- function areObjectsEqualStrict(a, b, state) {
195
- const properties = getStrictProperties(a);
196
- let index = properties.length;
197
- if (getStrictProperties(b).length !== index) {
198
- return false;
199
- }
200
- let property;
201
- let descriptorA;
202
- let descriptorB;
203
- // Decrementing `while` showed faster results than either incrementing or
204
- // decrementing `for` loop and than an incrementing `while` loop. Declarative
205
- // methods like `some` / `every` were not used to avoid incurring the garbage
206
- // cost of anonymous callbacks.
207
- while (index-- > 0) {
208
- property = properties[index];
209
- if (!isPropertyEqual(a, b, state, property)) {
210
- return false;
211
- }
212
- descriptorA = getOwnPropertyDescriptor(a, property);
213
- descriptorB = getOwnPropertyDescriptor(b, property);
214
- if ((descriptorA || descriptorB)
215
- && (!descriptorA
216
- || !descriptorB
217
- || descriptorA.configurable !== descriptorB.configurable
218
- || descriptorA.enumerable !== descriptorB.enumerable
219
- || descriptorA.writable !== descriptorB.writable)) {
220
- return false;
221
- }
222
- }
223
- return true;
224
- }
225
- /**
226
- * Whether the primitive wrappers passed are equal in value.
227
- */
228
- function arePrimitiveWrappersEqual(a, b) {
229
- return sameValueZeroEqual(a.valueOf(), b.valueOf());
230
- }
231
- /**
232
- * Whether the regexps passed are equal in value.
233
- */
234
- function areRegExpsEqual(a, b) {
235
- return a.source === b.source && a.flags === b.flags;
236
- }
237
- /**
238
- * Whether the `Set`s are equal in value.
239
- */
240
- function areSetsEqual(a, b, state) {
241
- const size = a.size;
242
- if (size !== b.size) {
243
- return false;
244
- }
245
- if (!size) {
246
- return true;
247
- }
248
- const matchedIndices = new Array(size);
249
- const aIterable = a.values();
250
- let aResult;
251
- let bResult;
252
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
253
- while ((aResult = aIterable.next())) {
254
- if (aResult.done) {
255
- break;
256
- }
257
- const bIterable = b.values();
258
- let hasMatch = false;
259
- let matchIndex = 0;
260
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
261
- while ((bResult = bIterable.next())) {
262
- if (bResult.done) {
263
- break;
264
- }
265
- if (!matchedIndices[matchIndex]
266
- && state.equals(aResult.value, bResult.value, aResult.value, bResult.value, a, b, state)) {
267
- hasMatch = matchedIndices[matchIndex] = true;
268
- break;
269
- }
270
- matchIndex++;
271
- }
272
- if (!hasMatch) {
273
- return false;
274
- }
275
- }
276
- return true;
277
- }
278
- /**
279
- * Whether the TypedArray instances are equal in value.
280
- */
281
- function areTypedArraysEqual(a, b) {
282
- let index = a.byteLength;
283
- if (b.byteLength !== index || a.byteOffset !== b.byteOffset) {
284
- return false;
285
- }
286
- while (index-- > 0) {
287
- if (a[index] !== b[index]) {
288
- return false;
289
- }
290
- }
291
- return true;
292
- }
293
- /**
294
- * Whether the URL instances are equal in value.
295
- */
296
- function areUrlsEqual(a, b) {
297
- return (a.hostname === b.hostname
298
- && a.pathname === b.pathname
299
- && a.protocol === b.protocol
300
- && a.port === b.port
301
- && a.hash === b.hash
302
- && a.username === b.username
303
- && a.password === b.password);
304
- }
305
- function isPropertyEqual(a, b, state, property) {
306
- if ((property === REACT_OWNER || property === PREACT_OWNER || property === PREACT_VNODE)
307
- && (a.$$typeof || b.$$typeof)) {
308
- return true;
309
- }
310
- return hasOwn(b, property) && state.equals(a[property], b[property], property, property, a, b, state);
311
- }
312
-
313
- const ARRAY_BUFFER_TAG = '[object ArrayBuffer]';
314
- const ARGUMENTS_TAG = '[object Arguments]';
315
- const BOOLEAN_TAG = '[object Boolean]';
316
- const DATA_VIEW_TAG = '[object DataView]';
317
- const DATE_TAG = '[object Date]';
318
- const ERROR_TAG = '[object Error]';
319
- const MAP_TAG = '[object Map]';
320
- const NUMBER_TAG = '[object Number]';
321
- const OBJECT_TAG = '[object Object]';
322
- const REG_EXP_TAG = '[object RegExp]';
323
- const SET_TAG = '[object Set]';
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
- };
339
- const URL_TAG = '[object URL]';
340
- // eslint-disable-next-line @typescript-eslint/unbound-method
341
- const toString = Object.prototype.toString;
342
- /**
343
- * Create a comparator method based on the type-specific equality comparators passed.
344
- */
345
- function createEqualityComparator({ areArrayBuffersEqual, areArraysEqual, areDataViewsEqual, areDatesEqual, areErrorsEqual, areFunctionsEqual, areMapsEqual, areNumbersEqual, areObjectsEqual, arePrimitiveWrappersEqual, areRegExpsEqual, areSetsEqual, areTypedArraysEqual, areUrlsEqual, unknownTagComparators, }) {
346
- /**
347
- * compare the value of the two objects and return true if they are equivalent in values
348
- */
349
- return function comparator(a, b, state) {
350
- // If the items are strictly equal, no need to do a value comparison.
351
- if (a === b) {
352
- return true;
353
- }
354
- // If either of the items are nullish and fail the strictly equal check
355
- // above, then they must be unequal.
356
- if (a == null || b == null) {
357
- return false;
358
- }
359
- const type = typeof a;
360
- if (type !== typeof b) {
361
- return false;
362
- }
363
- if (type !== 'object') {
364
- if (type === 'number') {
365
- return areNumbersEqual(a, b, state);
366
- }
367
- if (type === 'function') {
368
- return areFunctionsEqual(a, b, state);
369
- }
370
- // If a primitive value that is not strictly equal, it must be unequal.
371
- return false;
372
- }
373
- const constructor = a.constructor;
374
- // Checks are listed in order of commonality of use-case:
375
- // 1. Common complex object types (plain object, array)
376
- // 2. Common data values (date, regexp)
377
- // 3. Less-common complex object types (map, set)
378
- // 4. Less-common data values (promise, primitive wrappers)
379
- // Inherently this is both subjective and assumptive, however
380
- // when reviewing comparable libraries in the wild this order
381
- // appears to be generally consistent.
382
- // Constructors should match, otherwise there is potential for false positives
383
- // between class and subclass or custom object and POJO.
384
- if (constructor !== b.constructor) {
385
- return false;
386
- }
387
- // `isPlainObject` only checks against the object's own realm. Cross-realm
388
- // comparisons are rare, and will be handled in the ultimate fallback, so
389
- // we can avoid capturing the string tag.
390
- if (constructor === Object) {
391
- return areObjectsEqual(a, b, state);
392
- }
393
- // `isArray()` works on subclasses and is cross-realm, so we can avoid capturing
394
- // the string tag or doing an `instanceof` check.
395
- if (Array.isArray(a)) {
396
- return areArraysEqual(a, b, state);
397
- }
398
- // Try to fast-path equality checks for other complex object types in the
399
- // same realm to avoid capturing the string tag. Strict equality is used
400
- // instead of `instanceof` because it is more performant for the common
401
- // use-case. If someone is subclassing a native class, it will be handled
402
- // with the string tag comparison.
403
- if (constructor === Date) {
404
- return areDatesEqual(a, b, state);
405
- }
406
- if (constructor === RegExp) {
407
- return areRegExpsEqual(a, b, state);
408
- }
409
- if (constructor === Map) {
410
- return areMapsEqual(a, b, state);
411
- }
412
- if (constructor === Set) {
413
- return areSetsEqual(a, b, state);
414
- }
415
- // Since this is a custom object, capture the string tag to determing its type.
416
- // This is reasonably performant in modern environments like v8 and SpiderMonkey.
417
- const tag = toString.call(a);
418
- if (tag === DATE_TAG) {
419
- return areDatesEqual(a, b, state);
420
- }
421
- // For RegExp, the properties are not enumerable, and therefore will give false positives if
422
- // tested like a standard object.
423
- if (tag === REG_EXP_TAG) {
424
- return areRegExpsEqual(a, b, state);
425
- }
426
- if (tag === MAP_TAG) {
427
- return areMapsEqual(a, b, state);
428
- }
429
- if (tag === SET_TAG) {
430
- return areSetsEqual(a, b, state);
431
- }
432
- if (tag === OBJECT_TAG) {
433
- // The exception for value comparison is custom `Promise`-like class instances. These should
434
- // be treated the same as standard `Promise` objects, which means strict equality, and if
435
- // it reaches this point then that strict equality comparison has already failed.
436
- return typeof a.then !== 'function' && typeof b.then !== 'function' && areObjectsEqual(a, b, state);
437
- }
438
- // If a URL tag, it should be tested explicitly. Like RegExp, the properties are not
439
- // enumerable, and therefore will give false positives if tested like a standard object.
440
- if (tag === URL_TAG) {
441
- return areUrlsEqual(a, b, state);
442
- }
443
- // If an error tag, it should be tested explicitly. Like RegExp, the properties are not
444
- // enumerable, and therefore will give false positives if tested like a standard object.
445
- if (tag === ERROR_TAG) {
446
- return areErrorsEqual(a, b, state);
447
- }
448
- // If an arguments tag, it should be treated as a standard object.
449
- if (tag === ARGUMENTS_TAG) {
450
- return areObjectsEqual(a, b, state);
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
- }
461
- // As the penultimate fallback, check if the values passed are primitive wrappers. This
462
- // is very rare in modern JS, which is why it is deprioritized compared to all other object
463
- // types.
464
- if (tag === BOOLEAN_TAG || tag === NUMBER_TAG || tag === STRING_TAG) {
465
- return arePrimitiveWrappersEqual(a, b, state);
466
- }
467
- if (unknownTagComparators) {
468
- let unknownTagComparator = unknownTagComparators[tag];
469
- if (!unknownTagComparator) {
470
- const shortTag = getShortTag(a);
471
- if (shortTag) {
472
- unknownTagComparator = unknownTagComparators[shortTag];
473
- }
474
- }
475
- // If the custom config has an unknown tag comparator that matches the captured tag or the
476
- // @@toStringTag, it is the source of truth for whether the values are equal.
477
- if (unknownTagComparator) {
478
- return unknownTagComparator(a, b, state);
479
- }
480
- }
481
- // If not matching any tags that require a specific type of comparison, then we hard-code false because
482
- // the only thing remaining is strict equality, which has already been compared. This is for a few reasons:
483
- // - Certain types that cannot be introspected (e.g., `WeakMap`). For these types, this is the only
484
- // comparison that can be made.
485
- // - For types that can be introspected, but rarely have requirements to be compared
486
- // (`ArrayBuffer`, `DataView`, etc.), the cost is avoided to prioritize the common
487
- // use-cases (may be included in a future release, if requested enough).
488
- // - For types that can be introspected but do not have an objective definition of what
489
- // equality is (`Error`, etc.), the subjective decision is to be conservative and strictly compare.
490
- // In all cases, these decisions should be reevaluated based on changes to the language and
491
- // common development practices.
492
- return false;
493
- };
494
- }
495
- /**
496
- * Create the configuration object used for building comparators.
497
- */
498
- function createEqualityComparatorConfig({ circular, createCustomConfig, strict, }) {
499
- let config = {
500
- areArrayBuffersEqual,
501
- areArraysEqual: strict ? areObjectsEqualStrict : areArraysEqual,
502
- areDataViewsEqual,
503
- areDatesEqual: areDatesEqual,
504
- areErrorsEqual: areErrorsEqual,
505
- areFunctionsEqual: areFunctionsEqual,
506
- areMapsEqual: strict ? combineComparators(areMapsEqual, areObjectsEqualStrict) : areMapsEqual,
507
- areNumbersEqual: areNumbersEqual,
508
- areObjectsEqual: strict ? areObjectsEqualStrict : areObjectsEqual,
509
- arePrimitiveWrappersEqual: arePrimitiveWrappersEqual,
510
- areRegExpsEqual: areRegExpsEqual,
511
- areSetsEqual: strict ? combineComparators(areSetsEqual, areObjectsEqualStrict) : areSetsEqual,
512
- areTypedArraysEqual: strict
513
- ? combineComparators(areTypedArraysEqual, areObjectsEqualStrict)
514
- : areTypedArraysEqual,
515
- areUrlsEqual: areUrlsEqual,
516
- unknownTagComparators: undefined,
517
- };
518
- if (createCustomConfig) {
519
- config = Object.assign({}, config, createCustomConfig(config));
520
- }
521
- if (circular) {
522
- const areArraysEqual = createIsCircular(config.areArraysEqual);
523
- const areMapsEqual = createIsCircular(config.areMapsEqual);
524
- const areObjectsEqual = createIsCircular(config.areObjectsEqual);
525
- const areSetsEqual = createIsCircular(config.areSetsEqual);
526
- config = Object.assign({}, config, {
527
- areArraysEqual,
528
- areMapsEqual,
529
- areObjectsEqual,
530
- areSetsEqual,
531
- });
532
- }
533
- return config;
534
- }
535
- /**
536
- * Default equality comparator pass-through, used as the standard `isEqual` creator for
537
- * use inside the built comparator.
538
- */
539
- function createInternalEqualityComparator(compare) {
540
- return function (a, b, _indexOrKeyA, _indexOrKeyB, _parentA, _parentB, state) {
541
- return compare(a, b, state);
542
- };
543
- }
544
- /**
545
- * Create the `isEqual` function used by the consuming application.
546
- */
547
- function createIsEqual({ circular, comparator, createState, equals, strict }) {
548
- if (createState) {
549
- return function isEqual(a, b) {
550
- const { cache = circular ? new WeakMap() : undefined, meta } = createState();
551
- return comparator(a, b, {
552
- cache,
553
- equals,
554
- meta,
555
- strict,
556
- });
557
- };
558
- }
559
- if (circular) {
560
- return function isEqual(a, b) {
561
- return comparator(a, b, {
562
- cache: new WeakMap(),
563
- equals,
564
- meta: undefined,
565
- strict,
566
- });
567
- };
568
- }
569
- const state = {
570
- cache: undefined,
571
- equals,
572
- meta: undefined,
573
- strict,
574
- };
575
- return function isEqual(a, b) {
576
- return comparator(a, b, state);
577
- };
578
- }
579
-
580
- /**
581
- * Whether the items passed are deeply-equal in value.
582
- */
583
- const deepEqual = createCustomEqual();
584
- /**
585
- * Whether the items passed are deeply-equal in value based on strict comparison.
586
- */
587
- const strictDeepEqual = createCustomEqual({ strict: true });
588
- /**
589
- * Whether the items passed are deeply-equal in value, including circular references.
590
- */
591
- const circularDeepEqual = createCustomEqual({ circular: true });
592
- /**
593
- * Whether the items passed are deeply-equal in value, including circular references,
594
- * based on strict comparison.
595
- */
596
- const strictCircularDeepEqual = createCustomEqual({
597
- circular: true,
598
- strict: true,
599
- });
600
- /**
601
- * Whether the items passed are shallowly-equal in value.
602
- */
603
- const shallowEqual = createCustomEqual({
604
- createInternalComparator: () => sameValueZeroEqual,
605
- });
606
- /**
607
- * Whether the items passed are shallowly-equal in value based on strict comparison
608
- */
609
- const strictShallowEqual = createCustomEqual({
610
- strict: true,
611
- createInternalComparator: () => sameValueZeroEqual,
612
- });
613
- /**
614
- * Whether the items passed are shallowly-equal in value, including circular references.
615
- */
616
- const circularShallowEqual = createCustomEqual({
617
- circular: true,
618
- createInternalComparator: () => sameValueZeroEqual,
619
- });
620
- /**
621
- * Whether the items passed are shallowly-equal in value, including circular references,
622
- * based on strict comparison.
623
- */
624
- const strictCircularShallowEqual = createCustomEqual({
625
- circular: true,
626
- createInternalComparator: () => sameValueZeroEqual,
627
- strict: true,
628
- });
629
- /**
630
- * Create a custom equality comparison method.
631
- *
632
- * This can be done to create very targeted comparisons in extreme hot-path scenarios
633
- * where the standard methods are not performant enough, but can also be used to provide
634
- * support for legacy environments that do not support expected features like
635
- * `RegExp.prototype.flags` out of the box.
636
- */
637
- function createCustomEqual(options = {}) {
638
- const { circular = false, createInternalComparator: createCustomInternalComparator, createState, strict = false, } = options;
639
- const config = createEqualityComparatorConfig(options);
640
- const comparator = createEqualityComparator(config);
641
- const equals = createCustomInternalComparator
642
- ? createCustomInternalComparator(comparator)
643
- : createInternalEqualityComparator(comparator);
644
- return createIsEqual({ circular, comparator, createState, equals, strict });
645
- }
646
-
647
- exports.circularDeepEqual = circularDeepEqual;
648
- exports.circularShallowEqual = circularShallowEqual;
649
- exports.createCustomEqual = createCustomEqual;
650
- exports.deepEqual = deepEqual;
651
- exports.sameValueZeroEqual = sameValueZeroEqual;
652
- exports.shallowEqual = shallowEqual;
653
- exports.strictCircularDeepEqual = strictCircularDeepEqual;
654
- exports.strictCircularShallowEqual = strictCircularShallowEqual;
655
- exports.strictDeepEqual = strictDeepEqual;
656
- exports.strictShallowEqual = strictShallowEqual;
657
-
658
- }));
659
- //# sourceMappingURL=index.js.map