fast-equals 4.0.3 → 5.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/.babelrc +34 -0
- package/.prettierrc +4 -0
- package/CHANGELOG.md +39 -0
- package/README.md +145 -39
- package/build/rollup/config.base.js +49 -0
- package/build/rollup/config.cjs.js +10 -0
- package/build/rollup/config.esm.js +10 -0
- package/build/rollup/config.min.js +13 -0
- package/build/rollup/config.umd.js +10 -0
- package/build/tsconfig/base.json +32 -0
- package/build/tsconfig/cjs.json +8 -0
- package/build/tsconfig/declarations.json +9 -0
- package/build/tsconfig/esm.json +8 -0
- package/build/tsconfig/min.json +8 -0
- package/build/tsconfig/umd.json +8 -0
- package/build/webpack.config.js +57 -0
- package/dist/cjs/index.cjs +510 -0
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/cjs/types/comparator.d.ts +2 -0
- package/dist/cjs/types/equals.d.ts +46 -0
- package/dist/cjs/types/index.d.ts +56 -0
- package/dist/cjs/types/internalTypes.d.ts +36 -0
- package/dist/cjs/types/utils.d.ts +19 -0
- package/dist/esm/index.mjs +499 -0
- package/dist/esm/index.mjs.map +1 -0
- package/dist/esm/types/comparator.d.ts +2 -0
- package/dist/esm/types/equals.d.ts +46 -0
- package/dist/esm/types/index.d.ts +56 -0
- package/dist/esm/types/internalTypes.d.ts +36 -0
- package/dist/esm/types/utils.d.ts +19 -0
- package/dist/min/index.js +1 -0
- package/dist/min/types/comparator.d.ts +2 -0
- package/dist/min/types/equals.d.ts +46 -0
- package/dist/min/types/index.d.ts +56 -0
- package/dist/min/types/internalTypes.d.ts +36 -0
- package/dist/min/types/utils.d.ts +19 -0
- package/dist/umd/index.js +516 -0
- package/dist/umd/index.js.map +1 -0
- package/dist/umd/types/comparator.d.ts +2 -0
- package/dist/umd/types/equals.d.ts +46 -0
- package/dist/umd/types/index.d.ts +56 -0
- package/dist/umd/types/internalTypes.d.ts +36 -0
- package/dist/umd/types/utils.d.ts +19 -0
- package/package.json +58 -37
- package/recipes/explicit-property-check.md +4 -6
- package/recipes/legacy-circular-equal-support.md +28 -20
- package/recipes/legacy-regexp-support.md +15 -16
- package/recipes/non-standard-properties.md +35 -23
- package/recipes/using-meta-in-comparison.md +10 -13
- package/src/comparator.ts +43 -40
- package/src/equals.ts +263 -0
- package/src/index.ts +183 -79
- package/src/internalTypes.ts +74 -0
- package/src/utils.ts +42 -49
- package/dist/fast-equals.cjs.js +0 -432
- package/dist/fast-equals.cjs.js.map +0 -1
- package/dist/fast-equals.esm.js +0 -422
- package/dist/fast-equals.esm.js.map +0 -1
- package/dist/fast-equals.js +0 -438
- package/dist/fast-equals.js.map +0 -1
- package/dist/fast-equals.min.js +0 -1
- package/dist/fast-equals.mjs +0 -422
- package/dist/fast-equals.mjs.map +0 -1
- package/index.d.ts +0 -58
- package/recipes/strict-property-descriptor-check.md +0 -42
- package/src/arrays.ts +0 -36
- package/src/dates.ts +0 -12
- package/src/maps.ts +0 -66
- package/src/objects.ts +0 -62
- package/src/regexps.ts +0 -11
- package/src/sets.ts +0 -61
package/dist/fast-equals.js
DELETED
|
@@ -1,438 +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
|
-
/**
|
|
8
|
-
* Default equality comparator pass-through, used as the standard `isEqual` creator for
|
|
9
|
-
* use inside the built comparator.
|
|
10
|
-
*/
|
|
11
|
-
function createDefaultIsNestedEqual(comparator) {
|
|
12
|
-
return function isEqual(a, b, _indexOrKeyA, _indexOrKeyB, _parentA, _parentB, meta) {
|
|
13
|
-
return comparator(a, b, meta);
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Wrap the provided `areItemsEqual` method to manage the circular cache, allowing
|
|
18
|
-
* for circular references to be safely included in the comparison without creating
|
|
19
|
-
* stack overflows.
|
|
20
|
-
*/
|
|
21
|
-
function createIsCircular(areItemsEqual) {
|
|
22
|
-
return function isCircular(a, b, isEqual, cache) {
|
|
23
|
-
if (!a || !b || typeof a !== 'object' || typeof b !== 'object') {
|
|
24
|
-
return areItemsEqual(a, b, isEqual, cache);
|
|
25
|
-
}
|
|
26
|
-
var cachedA = cache.get(a);
|
|
27
|
-
var cachedB = cache.get(b);
|
|
28
|
-
if (cachedA && cachedB) {
|
|
29
|
-
return cachedA === b && cachedB === a;
|
|
30
|
-
}
|
|
31
|
-
cache.set(a, b);
|
|
32
|
-
cache.set(b, a);
|
|
33
|
-
var result = areItemsEqual(a, b, isEqual, cache);
|
|
34
|
-
cache.delete(a);
|
|
35
|
-
cache.delete(b);
|
|
36
|
-
return result;
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Targeted shallow merge of two objects.
|
|
41
|
-
*
|
|
42
|
-
* @NOTE
|
|
43
|
-
* This exists as a tinier compiled version of the `__assign` helper that
|
|
44
|
-
* `tsc` injects in case of `Object.assign` not being present.
|
|
45
|
-
*/
|
|
46
|
-
function merge(a, b) {
|
|
47
|
-
var merged = {};
|
|
48
|
-
for (var key in a) {
|
|
49
|
-
merged[key] = a[key];
|
|
50
|
-
}
|
|
51
|
-
for (var key in b) {
|
|
52
|
-
merged[key] = b[key];
|
|
53
|
-
}
|
|
54
|
-
return merged;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Whether the value is a plain object.
|
|
58
|
-
*
|
|
59
|
-
* @NOTE
|
|
60
|
-
* This is a same-realm compariosn only.
|
|
61
|
-
*/
|
|
62
|
-
function isPlainObject(value) {
|
|
63
|
-
return value.constructor === Object || value.constructor == null;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* When the value is `Promise`-like, aka "then-able".
|
|
67
|
-
*/
|
|
68
|
-
function isPromiseLike(value) {
|
|
69
|
-
return typeof value.then === 'function';
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Whether the values passed are strictly equal or both NaN.
|
|
73
|
-
*/
|
|
74
|
-
function sameValueZeroEqual(a, b) {
|
|
75
|
-
return a === b || (a !== a && b !== b);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
var ARGUMENTS_TAG = '[object Arguments]';
|
|
79
|
-
var BOOLEAN_TAG = '[object Boolean]';
|
|
80
|
-
var DATE_TAG = '[object Date]';
|
|
81
|
-
var REG_EXP_TAG = '[object RegExp]';
|
|
82
|
-
var MAP_TAG = '[object Map]';
|
|
83
|
-
var NUMBER_TAG = '[object Number]';
|
|
84
|
-
var OBJECT_TAG = '[object Object]';
|
|
85
|
-
var SET_TAG = '[object Set]';
|
|
86
|
-
var STRING_TAG = '[object String]';
|
|
87
|
-
var toString = Object.prototype.toString;
|
|
88
|
-
function createComparator(_a) {
|
|
89
|
-
var areArraysEqual = _a.areArraysEqual, areDatesEqual = _a.areDatesEqual, areMapsEqual = _a.areMapsEqual, areObjectsEqual = _a.areObjectsEqual, areRegExpsEqual = _a.areRegExpsEqual, areSetsEqual = _a.areSetsEqual, createIsNestedEqual = _a.createIsNestedEqual;
|
|
90
|
-
var isEqual = createIsNestedEqual(comparator);
|
|
91
|
-
/**
|
|
92
|
-
* compare the value of the two objects and return true if they are equivalent in values
|
|
93
|
-
*/
|
|
94
|
-
function comparator(a, b, meta) {
|
|
95
|
-
// If the items are strictly equal, no need to do a value comparison.
|
|
96
|
-
if (a === b) {
|
|
97
|
-
return true;
|
|
98
|
-
}
|
|
99
|
-
// If the items are not non-nullish objects, then the only possibility
|
|
100
|
-
// of them being equal but not strictly is if they are both `NaN`. Since
|
|
101
|
-
// `NaN` is uniquely not equal to itself, we can use self-comparison of
|
|
102
|
-
// both objects, which is faster than `isNaN()`.
|
|
103
|
-
if (!a || !b || typeof a !== 'object' || typeof b !== 'object') {
|
|
104
|
-
return a !== a && b !== b;
|
|
105
|
-
}
|
|
106
|
-
// Checks are listed in order of commonality of use-case:
|
|
107
|
-
// 1. Common complex object types (plain object, array)
|
|
108
|
-
// 2. Common data values (date, regexp)
|
|
109
|
-
// 3. Less-common complex object types (map, set)
|
|
110
|
-
// 4. Less-common data values (promise, primitive wrappers)
|
|
111
|
-
// Inherently this is both subjective and assumptive, however
|
|
112
|
-
// when reviewing comparable libraries in the wild this order
|
|
113
|
-
// appears to be generally consistent.
|
|
114
|
-
// `isPlainObject` only checks against the object's own realm. Cross-realm
|
|
115
|
-
// comparisons are rare, and will be handled in the ultimate fallback, so
|
|
116
|
-
// we can avoid the `toString.call()` cost unless necessary.
|
|
117
|
-
if (isPlainObject(a) && isPlainObject(b)) {
|
|
118
|
-
return areObjectsEqual(a, b, isEqual, meta);
|
|
119
|
-
}
|
|
120
|
-
// `isArray()` works on subclasses and is cross-realm, so we can again avoid
|
|
121
|
-
// the `toString.call()` cost unless necessary by just checking if either
|
|
122
|
-
// and then both are arrays.
|
|
123
|
-
var aArray = Array.isArray(a);
|
|
124
|
-
var bArray = Array.isArray(b);
|
|
125
|
-
if (aArray || bArray) {
|
|
126
|
-
return aArray === bArray && areArraysEqual(a, b, isEqual, meta);
|
|
127
|
-
}
|
|
128
|
-
// Since this is a custom object, use the classic `toString.call()` to get its
|
|
129
|
-
// type. This is reasonably performant in modern environments like v8 and
|
|
130
|
-
// SpiderMonkey, and allows for cross-realm comparison when other checks like
|
|
131
|
-
// `instanceof` do not.
|
|
132
|
-
var aTag = toString.call(a);
|
|
133
|
-
if (aTag !== toString.call(b)) {
|
|
134
|
-
return false;
|
|
135
|
-
}
|
|
136
|
-
if (aTag === DATE_TAG) {
|
|
137
|
-
// `getTime()` showed better results compared to alternatives like `valueOf()`
|
|
138
|
-
// or the unary `+` operator.
|
|
139
|
-
return areDatesEqual(a, b, isEqual, meta);
|
|
140
|
-
}
|
|
141
|
-
if (aTag === REG_EXP_TAG) {
|
|
142
|
-
return areRegExpsEqual(a, b, isEqual, meta);
|
|
143
|
-
}
|
|
144
|
-
if (aTag === MAP_TAG) {
|
|
145
|
-
return areMapsEqual(a, b, isEqual, meta);
|
|
146
|
-
}
|
|
147
|
-
if (aTag === SET_TAG) {
|
|
148
|
-
return areSetsEqual(a, b, isEqual, meta);
|
|
149
|
-
}
|
|
150
|
-
// If a simple object tag, then we can prioritize a simple object comparison because
|
|
151
|
-
// it is likely a custom class. If an arguments tag, it should be treated as a standard
|
|
152
|
-
// object.
|
|
153
|
-
if (aTag === OBJECT_TAG || aTag === ARGUMENTS_TAG) {
|
|
154
|
-
// The exception for value comparison is `Promise`-like contracts. These should be
|
|
155
|
-
// treated the same as standard `Promise` objects, which means strict equality.
|
|
156
|
-
return isPromiseLike(a) || isPromiseLike(b)
|
|
157
|
-
? false
|
|
158
|
-
: areObjectsEqual(a, b, isEqual, meta);
|
|
159
|
-
}
|
|
160
|
-
// As the penultimate fallback, check if the values passed are primitive wrappers. This
|
|
161
|
-
// is very rare in modern JS, which is why it is deprioritized compared to all other object
|
|
162
|
-
// types.
|
|
163
|
-
if (aTag === BOOLEAN_TAG || aTag === NUMBER_TAG || aTag === STRING_TAG) {
|
|
164
|
-
return sameValueZeroEqual(a.valueOf(), b.valueOf());
|
|
165
|
-
}
|
|
166
|
-
// If not matching any tags that require a specific type of comparison, then we hard-code false because
|
|
167
|
-
// the only thing remaining is strict equality, which has already been compared. This is for a few reasons:
|
|
168
|
-
// - Certain types that cannot be introspected (e.g., `WeakMap`). For these types, this is the only
|
|
169
|
-
// comparison that can be made.
|
|
170
|
-
// - For types that can be introspected, but rarely have requirements to be compared
|
|
171
|
-
// (`ArrayBuffer`, `DataView`, etc.), the cost is avoided to prioritize the common
|
|
172
|
-
// use-cases (may be included in a future release, if requested enough).
|
|
173
|
-
// - For types that can be introspected but do not have an objective definition of what
|
|
174
|
-
// equality is (`Error`, etc.), the subjective decision is to be conservative and strictly compare.
|
|
175
|
-
// In all cases, these decisions should be reevaluated based on changes to the language and
|
|
176
|
-
// common development practices.
|
|
177
|
-
return false;
|
|
178
|
-
}
|
|
179
|
-
return comparator;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
/**
|
|
183
|
-
* Whether the arrays are equal in value.
|
|
184
|
-
*/
|
|
185
|
-
function areArraysEqual(a, b, isEqual, meta) {
|
|
186
|
-
var index = a.length;
|
|
187
|
-
if (b.length !== index) {
|
|
188
|
-
return false;
|
|
189
|
-
}
|
|
190
|
-
// Decrementing `while` showed faster results than either incrementing or
|
|
191
|
-
// decrementing `for` loop and than an incrementing `while` loop. Declarative
|
|
192
|
-
// methods like `some` / `every` were not used to avoid incurring the garbage
|
|
193
|
-
// cost of anonymous callbacks.
|
|
194
|
-
while (index-- > 0) {
|
|
195
|
-
if (!isEqual(a[index], b[index], index, index, a, b, meta)) {
|
|
196
|
-
return false;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
return true;
|
|
200
|
-
}
|
|
201
|
-
/**
|
|
202
|
-
* Whether the arrays are equal in value, including circular references.
|
|
203
|
-
*/
|
|
204
|
-
var areArraysEqualCircular = createIsCircular(areArraysEqual);
|
|
205
|
-
|
|
206
|
-
/**
|
|
207
|
-
* Whether the dates passed are equal in value.
|
|
208
|
-
*
|
|
209
|
-
* @NOTE
|
|
210
|
-
* This is a standalone function instead of done inline in the comparator
|
|
211
|
-
* to allow for overrides.
|
|
212
|
-
*/
|
|
213
|
-
function areDatesEqual(a, b) {
|
|
214
|
-
return sameValueZeroEqual(a.valueOf(), b.valueOf());
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
/**
|
|
218
|
-
* Whether the `Map`s are equal in value.
|
|
219
|
-
*/
|
|
220
|
-
function areMapsEqual(a, b, isEqual, meta) {
|
|
221
|
-
var isValueEqual = a.size === b.size;
|
|
222
|
-
if (!isValueEqual) {
|
|
223
|
-
return false;
|
|
224
|
-
}
|
|
225
|
-
if (!a.size) {
|
|
226
|
-
return true;
|
|
227
|
-
}
|
|
228
|
-
// The use of `forEach()` is to avoid the transpilation cost of `for...of` comparisons, and
|
|
229
|
-
// the inability to control the performance of the resulting code. It also avoids excessive
|
|
230
|
-
// iteration compared to doing comparisons of `keys()` and `values()`. As a result, though,
|
|
231
|
-
// we cannot short-circuit the iterations; bookkeeping must be done to short-circuit the
|
|
232
|
-
// equality checks themselves.
|
|
233
|
-
var matchedIndices = {};
|
|
234
|
-
var indexA = 0;
|
|
235
|
-
a.forEach(function (aValue, aKey) {
|
|
236
|
-
if (!isValueEqual) {
|
|
237
|
-
return;
|
|
238
|
-
}
|
|
239
|
-
var hasMatch = false;
|
|
240
|
-
var matchIndexB = 0;
|
|
241
|
-
b.forEach(function (bValue, bKey) {
|
|
242
|
-
if (!hasMatch &&
|
|
243
|
-
!matchedIndices[matchIndexB] &&
|
|
244
|
-
(hasMatch =
|
|
245
|
-
isEqual(aKey, bKey, indexA, matchIndexB, a, b, meta) &&
|
|
246
|
-
isEqual(aValue, bValue, aKey, bKey, a, b, meta))) {
|
|
247
|
-
matchedIndices[matchIndexB] = true;
|
|
248
|
-
}
|
|
249
|
-
matchIndexB++;
|
|
250
|
-
});
|
|
251
|
-
indexA++;
|
|
252
|
-
isValueEqual = hasMatch;
|
|
253
|
-
});
|
|
254
|
-
return isValueEqual;
|
|
255
|
-
}
|
|
256
|
-
/**
|
|
257
|
-
* Whether the `Map`s are equal in value, including circular references.
|
|
258
|
-
*/
|
|
259
|
-
var areMapsEqualCircular = createIsCircular(areMapsEqual);
|
|
260
|
-
|
|
261
|
-
var OWNER = '_owner';
|
|
262
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
263
|
-
/**
|
|
264
|
-
* Whether the objects are equal in value.
|
|
265
|
-
*/
|
|
266
|
-
function areObjectsEqual(a, b, isEqual, meta) {
|
|
267
|
-
var keysA = Object.keys(a);
|
|
268
|
-
var index = keysA.length;
|
|
269
|
-
if (Object.keys(b).length !== index) {
|
|
270
|
-
return false;
|
|
271
|
-
}
|
|
272
|
-
var key;
|
|
273
|
-
// Decrementing `while` showed faster results than either incrementing or
|
|
274
|
-
// decrementing `for` loop and than an incrementing `while` loop. Declarative
|
|
275
|
-
// methods like `some` / `every` were not used to avoid incurring the garbage
|
|
276
|
-
// cost of anonymous callbacks.
|
|
277
|
-
while (index-- > 0) {
|
|
278
|
-
key = keysA[index];
|
|
279
|
-
if (key === OWNER) {
|
|
280
|
-
var reactElementA = !!a.$$typeof;
|
|
281
|
-
var reactElementB = !!b.$$typeof;
|
|
282
|
-
if ((reactElementA || reactElementB) && reactElementA !== reactElementB) {
|
|
283
|
-
return false;
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
if (!hasOwnProperty.call(b, key) ||
|
|
287
|
-
!isEqual(a[key], b[key], key, key, a, b, meta)) {
|
|
288
|
-
return false;
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
return true;
|
|
292
|
-
}
|
|
293
|
-
/**
|
|
294
|
-
* Whether the objects are equal in value, including circular references.
|
|
295
|
-
*/
|
|
296
|
-
var areObjectsEqualCircular = createIsCircular(areObjectsEqual);
|
|
297
|
-
|
|
298
|
-
/**
|
|
299
|
-
* Whether the regexps passed are equal in value.
|
|
300
|
-
*
|
|
301
|
-
* @NOTE
|
|
302
|
-
* This is a standalone function instead of done inline in the comparator
|
|
303
|
-
* to allow for overrides. An example of this would be supporting a
|
|
304
|
-
* pre-ES2015 environment where the `flags` property is not available.
|
|
305
|
-
*/
|
|
306
|
-
function areRegExpsEqual(a, b) {
|
|
307
|
-
return a.source === b.source && a.flags === b.flags;
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
/**
|
|
311
|
-
* Whether the `Set`s are equal in value.
|
|
312
|
-
*/
|
|
313
|
-
function areSetsEqual(a, b, isEqual, meta) {
|
|
314
|
-
var isValueEqual = a.size === b.size;
|
|
315
|
-
if (!isValueEqual) {
|
|
316
|
-
return false;
|
|
317
|
-
}
|
|
318
|
-
if (!a.size) {
|
|
319
|
-
return true;
|
|
320
|
-
}
|
|
321
|
-
// The use of `forEach()` is to avoid the transpilation cost of `for...of` comparisons, and
|
|
322
|
-
// the inability to control the performance of the resulting code. It also avoids excessive
|
|
323
|
-
// iteration compared to doing comparisons of `keys()` and `values()`. As a result, though,
|
|
324
|
-
// we cannot short-circuit the iterations; bookkeeping must be done to short-circuit the
|
|
325
|
-
// equality checks themselves.
|
|
326
|
-
var matchedIndices = {};
|
|
327
|
-
a.forEach(function (aValue, aKey) {
|
|
328
|
-
if (!isValueEqual) {
|
|
329
|
-
return;
|
|
330
|
-
}
|
|
331
|
-
var hasMatch = false;
|
|
332
|
-
var matchIndex = 0;
|
|
333
|
-
b.forEach(function (bValue, bKey) {
|
|
334
|
-
if (!hasMatch &&
|
|
335
|
-
!matchedIndices[matchIndex] &&
|
|
336
|
-
(hasMatch = isEqual(aValue, bValue, aKey, bKey, a, b, meta))) {
|
|
337
|
-
matchedIndices[matchIndex] = true;
|
|
338
|
-
}
|
|
339
|
-
matchIndex++;
|
|
340
|
-
});
|
|
341
|
-
isValueEqual = hasMatch;
|
|
342
|
-
});
|
|
343
|
-
return isValueEqual;
|
|
344
|
-
}
|
|
345
|
-
/**
|
|
346
|
-
* Whether the `Set`s are equal in value, including circular references.
|
|
347
|
-
*/
|
|
348
|
-
var areSetsEqualCircular = createIsCircular(areSetsEqual);
|
|
349
|
-
|
|
350
|
-
var DEFAULT_CONFIG = Object.freeze({
|
|
351
|
-
areArraysEqual: areArraysEqual,
|
|
352
|
-
areDatesEqual: areDatesEqual,
|
|
353
|
-
areMapsEqual: areMapsEqual,
|
|
354
|
-
areObjectsEqual: areObjectsEqual,
|
|
355
|
-
areRegExpsEqual: areRegExpsEqual,
|
|
356
|
-
areSetsEqual: areSetsEqual,
|
|
357
|
-
createIsNestedEqual: createDefaultIsNestedEqual,
|
|
358
|
-
});
|
|
359
|
-
var DEFAULT_CIRCULAR_CONFIG = Object.freeze({
|
|
360
|
-
areArraysEqual: areArraysEqualCircular,
|
|
361
|
-
areDatesEqual: areDatesEqual,
|
|
362
|
-
areMapsEqual: areMapsEqualCircular,
|
|
363
|
-
areObjectsEqual: areObjectsEqualCircular,
|
|
364
|
-
areRegExpsEqual: areRegExpsEqual,
|
|
365
|
-
areSetsEqual: areSetsEqualCircular,
|
|
366
|
-
createIsNestedEqual: createDefaultIsNestedEqual,
|
|
367
|
-
});
|
|
368
|
-
var isDeepEqual = createComparator(DEFAULT_CONFIG);
|
|
369
|
-
/**
|
|
370
|
-
* Whether the items passed are deeply-equal in value.
|
|
371
|
-
*/
|
|
372
|
-
function deepEqual(a, b) {
|
|
373
|
-
return isDeepEqual(a, b, undefined);
|
|
374
|
-
}
|
|
375
|
-
var isShallowEqual = createComparator(merge(DEFAULT_CONFIG, { createIsNestedEqual: function () { return sameValueZeroEqual; } }));
|
|
376
|
-
/**
|
|
377
|
-
* Whether the items passed are shallowly-equal in value.
|
|
378
|
-
*/
|
|
379
|
-
function shallowEqual(a, b) {
|
|
380
|
-
return isShallowEqual(a, b, undefined);
|
|
381
|
-
}
|
|
382
|
-
var isCircularDeepEqual = createComparator(DEFAULT_CIRCULAR_CONFIG);
|
|
383
|
-
/**
|
|
384
|
-
* Whether the items passed are deeply-equal in value, including circular references.
|
|
385
|
-
*/
|
|
386
|
-
function circularDeepEqual(a, b) {
|
|
387
|
-
return isCircularDeepEqual(a, b, new WeakMap());
|
|
388
|
-
}
|
|
389
|
-
var isCircularShallowEqual = createComparator(merge(DEFAULT_CIRCULAR_CONFIG, {
|
|
390
|
-
createIsNestedEqual: function () { return sameValueZeroEqual; },
|
|
391
|
-
}));
|
|
392
|
-
/**
|
|
393
|
-
* Whether the items passed are shallowly-equal in value, including circular references.
|
|
394
|
-
*/
|
|
395
|
-
function circularShallowEqual(a, b) {
|
|
396
|
-
return isCircularShallowEqual(a, b, new WeakMap());
|
|
397
|
-
}
|
|
398
|
-
/**
|
|
399
|
-
* Create a custom equality comparison method.
|
|
400
|
-
*
|
|
401
|
-
* This can be done to create very targeted comparisons in extreme hot-path scenarios
|
|
402
|
-
* where the standard methods are not performant enough, but can also be used to provide
|
|
403
|
-
* support for legacy environments that do not support expected features like
|
|
404
|
-
* `RegExp.prototype.flags` out of the box.
|
|
405
|
-
*/
|
|
406
|
-
function createCustomEqual(getComparatorOptions) {
|
|
407
|
-
return createComparator(merge(DEFAULT_CONFIG, getComparatorOptions(DEFAULT_CONFIG)));
|
|
408
|
-
}
|
|
409
|
-
/**
|
|
410
|
-
* Create a custom equality comparison method that handles circular references. This is very
|
|
411
|
-
* similar to `createCustomEqual`, with the only difference being that `meta` expects to be
|
|
412
|
-
* populated with a `WeakMap`-like contract.
|
|
413
|
-
*
|
|
414
|
-
* This can be done to create very targeted comparisons in extreme hot-path scenarios
|
|
415
|
-
* where the standard methods are not performant enough, but can also be used to provide
|
|
416
|
-
* support for legacy environments that do not support expected features like
|
|
417
|
-
* `WeakMap` out of the box.
|
|
418
|
-
*/
|
|
419
|
-
function createCustomCircularEqual(getComparatorOptions) {
|
|
420
|
-
var comparator = createComparator(merge(DEFAULT_CIRCULAR_CONFIG, getComparatorOptions(DEFAULT_CIRCULAR_CONFIG)));
|
|
421
|
-
return (function (a, b, meta) {
|
|
422
|
-
if (meta === void 0) { meta = new WeakMap(); }
|
|
423
|
-
return comparator(a, b, meta);
|
|
424
|
-
});
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
exports.circularDeepEqual = circularDeepEqual;
|
|
428
|
-
exports.circularShallowEqual = circularShallowEqual;
|
|
429
|
-
exports.createCustomCircularEqual = createCustomCircularEqual;
|
|
430
|
-
exports.createCustomEqual = createCustomEqual;
|
|
431
|
-
exports.deepEqual = deepEqual;
|
|
432
|
-
exports.sameValueZeroEqual = sameValueZeroEqual;
|
|
433
|
-
exports.shallowEqual = shallowEqual;
|
|
434
|
-
|
|
435
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
436
|
-
|
|
437
|
-
}));
|
|
438
|
-
//# sourceMappingURL=fast-equals.js.map
|
package/dist/fast-equals.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fast-equals.js","sources":["../src/utils.ts","../src/comparator.ts","../src/arrays.ts","../src/dates.ts","../src/maps.ts","../src/objects.ts","../src/regexps.ts","../src/sets.ts","../src/index.ts"],"sourcesContent":["import {\n EqualityComparator,\n InternalEqualityComparator,\n TypeEqualityComparator,\n} from '../index.d';\n\n/**\n * Default equality comparator pass-through, used as the standard `isEqual` creator for\n * use inside the built comparator.\n */\nexport function createDefaultIsNestedEqual<Meta>(\n comparator: EqualityComparator<Meta>,\n): InternalEqualityComparator<Meta> {\n return function isEqual<A, B>(\n a: A,\n b: B,\n _indexOrKeyA: any,\n _indexOrKeyB: any,\n _parentA: any,\n _parentB: any,\n meta: Meta,\n ) {\n return comparator(a, b, meta);\n };\n}\n\n/**\n * Wrap the provided `areItemsEqual` method to manage the circular cache, allowing\n * for circular references to be safely included in the comparison without creating\n * stack overflows.\n */\nexport function createIsCircular<\n AreItemsEqual extends TypeEqualityComparator<any, any>,\n>(areItemsEqual: AreItemsEqual): AreItemsEqual {\n return function isCircular(\n a: any,\n b: any,\n isEqual: InternalEqualityComparator<WeakMap<any, any>>,\n cache: WeakMap<any, any>,\n ) {\n if (!a || !b || typeof a !== 'object' || typeof b !== 'object') {\n return areItemsEqual(a, b, isEqual, cache);\n }\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, isEqual, cache);\n\n cache.delete(a);\n cache.delete(b);\n\n return result;\n } as AreItemsEqual;\n}\n\n/**\n * Targeted shallow merge of two objects.\n *\n * @NOTE\n * This exists as a tinier compiled version of the `__assign` helper that\n * `tsc` injects in case of `Object.assign` not being present.\n */\nexport function merge<A extends object, B extends object>(a: A, b: B): A & B {\n const merged: Record<string, any> = {};\n\n for (const key in a) {\n merged[key] = a[key];\n }\n\n for (const key in b) {\n merged[key] = b[key];\n }\n\n return merged as A & B;\n}\n\n/**\n * Whether the value is a plain object.\n *\n * @NOTE\n * This is a same-realm compariosn only.\n */\nexport function isPlainObject(value: any): boolean {\n return value.constructor === Object || value.constructor == null;\n}\n\n/**\n * When the value is `Promise`-like, aka \"then-able\".\n */\nexport function isPromiseLike(value: any): boolean {\n return typeof value.then === 'function';\n}\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 !== a && b !== b);\n}\n","import { isPlainObject, isPromiseLike, sameValueZeroEqual } from './utils';\n\nimport type {\n CreateComparatorCreatorOptions,\n EqualityComparator,\n} from '../index.d';\n\nconst ARGUMENTS_TAG = '[object Arguments]';\nconst BOOLEAN_TAG = '[object Boolean]';\nconst DATE_TAG = '[object Date]';\nconst REG_EXP_TAG = '[object RegExp]';\nconst MAP_TAG = '[object Map]';\nconst NUMBER_TAG = '[object Number]';\nconst OBJECT_TAG = '[object Object]';\nconst SET_TAG = '[object Set]';\nconst STRING_TAG = '[object String]';\n\nconst { toString } = Object.prototype;\n\nexport function createComparator<Meta>({\n areArraysEqual,\n areDatesEqual,\n areMapsEqual,\n areObjectsEqual,\n areRegExpsEqual,\n areSetsEqual,\n createIsNestedEqual,\n}: CreateComparatorCreatorOptions<Meta>): EqualityComparator<Meta> {\n const isEqual = createIsNestedEqual(comparator as EqualityComparator<Meta>);\n\n /**\n * compare the value of the two objects and return true if they are equivalent in values\n */\n function comparator(a: any, b: any, meta: 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 the items are not non-nullish objects, then the only possibility\n // of them being equal but not strictly is if they are both `NaN`. Since\n // `NaN` is uniquely not equal to itself, we can use self-comparison of\n // both objects, which is faster than `isNaN()`.\n if (!a || !b || typeof a !== 'object' || typeof b !== 'object') {\n return a !== a && b !== b;\n }\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 // `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 the `toString.call()` cost unless necessary.\n if (isPlainObject(a) && isPlainObject(b)) {\n return areObjectsEqual(a, b, isEqual, meta);\n }\n\n // `isArray()` works on subclasses and is cross-realm, so we can again avoid\n // the `toString.call()` cost unless necessary by just checking if either\n // and then both are arrays.\n const aArray = Array.isArray(a);\n const bArray = Array.isArray(b);\n\n if (aArray || bArray) {\n return aArray === bArray && areArraysEqual(a, b, isEqual, meta);\n }\n\n // Since this is a custom object, use the classic `toString.call()` to get its\n // type. This is reasonably performant in modern environments like v8 and\n // SpiderMonkey, and allows for cross-realm comparison when other checks like\n // `instanceof` do not.\n const aTag = toString.call(a);\n\n if (aTag !== toString.call(b)) {\n return false;\n }\n\n if (aTag === DATE_TAG) {\n // `getTime()` showed better results compared to alternatives like `valueOf()`\n // or the unary `+` operator.\n return areDatesEqual(a, b, isEqual, meta);\n }\n\n if (aTag === REG_EXP_TAG) {\n return areRegExpsEqual(a, b, isEqual, meta);\n }\n\n if (aTag === MAP_TAG) {\n return areMapsEqual(a, b, isEqual, meta);\n }\n\n if (aTag === SET_TAG) {\n return areSetsEqual(a, b, isEqual, meta);\n }\n\n // If a simple object tag, then we can prioritize a simple object comparison because\n // it is likely a custom class. If an arguments tag, it should be treated as a standard\n // object.\n if (aTag === OBJECT_TAG || aTag === ARGUMENTS_TAG) {\n // The exception for value comparison is `Promise`-like contracts. These should be\n // treated the same as standard `Promise` objects, which means strict equality.\n return isPromiseLike(a) || isPromiseLike(b)\n ? false\n : areObjectsEqual(a, b, isEqual, meta);\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 (aTag === BOOLEAN_TAG || aTag === NUMBER_TAG || aTag === STRING_TAG) {\n return sameValueZeroEqual(a.valueOf(), b.valueOf());\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 return comparator as EqualityComparator<Meta>;\n}\n","import { createIsCircular } from './utils';\n\nimport type { InternalEqualityComparator } from '../index.d';\n\n/**\n * Whether the arrays are equal in value.\n */\nexport function areArraysEqual(\n a: any[],\n b: any[],\n isEqual: InternalEqualityComparator<any>,\n meta: any,\n): boolean {\n let index = a.length;\n\n if (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 (!isEqual(a[index], b[index], index, index, a, b, meta)) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the arrays are equal in value, including circular references.\n */\nexport const areArraysEqualCircular = createIsCircular(areArraysEqual);\n","import { sameValueZeroEqual } from './utils';\n\n/**\n * Whether the dates passed are equal in value.\n *\n * @NOTE\n * This is a standalone function instead of done inline in the comparator\n * to allow for overrides.\n */\nexport function areDatesEqual(a: Date, b: Date): boolean {\n return sameValueZeroEqual(a.valueOf(), b.valueOf());\n}\n","import { createIsCircular } from './utils';\n\nimport type { InternalEqualityComparator } from '../index.d';\n\n/**\n * Whether the `Map`s are equal in value.\n */\nexport function areMapsEqual(\n a: Map<any, any>,\n b: Map<any, any>,\n isEqual: InternalEqualityComparator<any>,\n meta: any,\n): boolean {\n let isValueEqual = a.size === b.size;\n\n if (!isValueEqual) {\n return false;\n }\n\n if (!a.size) {\n return true;\n }\n\n // The use of `forEach()` is to avoid the transpilation cost of `for...of` comparisons, and\n // the inability to control the performance of the resulting code. It also avoids excessive\n // iteration compared to doing comparisons of `keys()` and `values()`. As a result, though,\n // we cannot short-circuit the iterations; bookkeeping must be done to short-circuit the\n // equality checks themselves.\n\n const matchedIndices: Record<number, true> = {};\n\n let indexA = 0;\n\n a.forEach((aValue, aKey) => {\n if (!isValueEqual) {\n return;\n }\n\n let hasMatch = false;\n let matchIndexB = 0;\n\n b.forEach((bValue, bKey) => {\n if (\n !hasMatch &&\n !matchedIndices[matchIndexB] &&\n (hasMatch =\n isEqual(aKey, bKey, indexA, matchIndexB, a, b, meta) &&\n isEqual(aValue, bValue, aKey, bKey, a, b, meta))\n ) {\n matchedIndices[matchIndexB] = true;\n }\n\n matchIndexB++;\n });\n\n indexA++;\n isValueEqual = hasMatch;\n });\n\n return isValueEqual;\n}\n\n/**\n * Whether the `Map`s are equal in value, including circular references.\n */\nexport const areMapsEqualCircular = createIsCircular(areMapsEqual);\n","import { createIsCircular } from './utils';\n\nimport type { InternalEqualityComparator } from '../index.d';\n\ninterface Dictionary<Value> {\n [key: string]: Value;\n $$typeof?: any;\n}\n\nconst OWNER = '_owner';\nconst { hasOwnProperty } = Object.prototype;\n\n/**\n * Whether the objects are equal in value.\n */\nexport function areObjectsEqual(\n a: Dictionary<any>,\n b: Dictionary<any>,\n isEqual: InternalEqualityComparator<any>,\n meta: any,\n): boolean {\n const keysA = Object.keys(a);\n\n let index = keysA.length;\n\n if (Object.keys(b).length !== index) {\n return false;\n }\n\n let key: string;\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 key = keysA[index];\n\n if (key === OWNER) {\n const reactElementA = !!a.$$typeof;\n const reactElementB = !!b.$$typeof;\n\n if ((reactElementA || reactElementB) && reactElementA !== reactElementB) {\n return false;\n }\n }\n\n if (\n !hasOwnProperty.call(b, key) ||\n !isEqual(a[key], b[key], key, key, a, b, meta)\n ) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the objects are equal in value, including circular references.\n */\nexport const areObjectsEqualCircular = createIsCircular(areObjectsEqual);\n","/**\n * Whether the regexps passed are equal in value.\n *\n * @NOTE\n * This is a standalone function instead of done inline in the comparator\n * to allow for overrides. An example of this would be supporting a\n * pre-ES2015 environment where the `flags` property is not available.\n */\nexport function areRegExpsEqual(a: RegExp, b: RegExp): boolean {\n return a.source === b.source && a.flags === b.flags;\n}\n","import { createIsCircular } from './utils';\n\nimport type { InternalEqualityComparator } from '../index.d';\n\n/**\n * Whether the `Set`s are equal in value.\n */\nexport function areSetsEqual(\n a: Set<any>,\n b: Set<any>,\n isEqual: InternalEqualityComparator<any>,\n meta: any,\n): boolean {\n let isValueEqual = a.size === b.size;\n\n if (!isValueEqual) {\n return false;\n }\n\n if (!a.size) {\n return true;\n }\n\n // The use of `forEach()` is to avoid the transpilation cost of `for...of` comparisons, and\n // the inability to control the performance of the resulting code. It also avoids excessive\n // iteration compared to doing comparisons of `keys()` and `values()`. As a result, though,\n // we cannot short-circuit the iterations; bookkeeping must be done to short-circuit the\n // equality checks themselves.\n\n const matchedIndices: Record<number, true> = {};\n\n a.forEach((aValue, aKey) => {\n if (!isValueEqual) {\n return;\n }\n\n let hasMatch = false;\n let matchIndex = 0;\n\n b.forEach((bValue, bKey) => {\n if (\n !hasMatch &&\n !matchedIndices[matchIndex] &&\n (hasMatch = isEqual(aValue, bValue, aKey, bKey, a, b, meta))\n ) {\n matchedIndices[matchIndex] = true;\n }\n\n matchIndex++;\n });\n\n isValueEqual = hasMatch;\n });\n\n return isValueEqual;\n}\n\n/**\n * Whether the `Set`s are equal in value, including circular references.\n */\nexport const areSetsEqualCircular = createIsCircular(areSetsEqual);\n","import { createComparator } from './comparator';\nimport { areArraysEqual, areArraysEqualCircular } from './arrays';\nimport { areDatesEqual } from './dates';\nimport { areMapsEqual, areMapsEqualCircular } from './maps';\nimport { areObjectsEqual, areObjectsEqualCircular } from './objects';\nimport { areRegExpsEqual } from './regexps';\nimport { areSetsEqual, areSetsEqualCircular } from './sets';\nimport { createDefaultIsNestedEqual, merge, sameValueZeroEqual } from './utils';\n\nimport type {\n BaseCircularMeta,\n CreateComparatorCreatorOptions,\n EqualityComparator,\n GetComparatorOptions,\n} from '../index.d';\n\nexport { sameValueZeroEqual };\n\nconst DEFAULT_CONFIG: CreateComparatorCreatorOptions<undefined> = Object.freeze(\n {\n areArraysEqual,\n areDatesEqual,\n areMapsEqual,\n areObjectsEqual,\n areRegExpsEqual,\n areSetsEqual,\n createIsNestedEqual: createDefaultIsNestedEqual,\n },\n);\nconst DEFAULT_CIRCULAR_CONFIG: CreateComparatorCreatorOptions<BaseCircularMeta> =\n Object.freeze({\n areArraysEqual: areArraysEqualCircular,\n areDatesEqual,\n areMapsEqual: areMapsEqualCircular,\n areObjectsEqual: areObjectsEqualCircular,\n areRegExpsEqual,\n areSetsEqual: areSetsEqualCircular,\n createIsNestedEqual: createDefaultIsNestedEqual,\n });\n\nconst isDeepEqual = createComparator(DEFAULT_CONFIG);\n\n/**\n * Whether the items passed are deeply-equal in value.\n */\nexport function deepEqual<A, B>(a: A, b: B): boolean {\n return isDeepEqual(a, b, undefined);\n}\n\nconst isShallowEqual = createComparator(\n merge(DEFAULT_CONFIG, { createIsNestedEqual: () => sameValueZeroEqual }),\n);\n\n/**\n * Whether the items passed are shallowly-equal in value.\n */\nexport function shallowEqual<A, B>(a: A, b: B): boolean {\n return isShallowEqual(a, b, undefined);\n}\n\nconst isCircularDeepEqual = createComparator(DEFAULT_CIRCULAR_CONFIG);\n\n/**\n * Whether the items passed are deeply-equal in value, including circular references.\n */\nexport function circularDeepEqual<A, B>(a: A, b: B): boolean {\n return isCircularDeepEqual(a, b, new WeakMap());\n}\n\nconst isCircularShallowEqual = createComparator(\n merge(DEFAULT_CIRCULAR_CONFIG, {\n createIsNestedEqual: () => sameValueZeroEqual,\n }),\n);\n\n/**\n * Whether the items passed are shallowly-equal in value, including circular references.\n */\nexport function circularShallowEqual<A, B>(a: A, b: B): boolean {\n return isCircularShallowEqual(a, b, new WeakMap());\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>(\n getComparatorOptions: GetComparatorOptions<Meta>,\n): EqualityComparator<Meta> {\n return createComparator<Meta>(\n merge(DEFAULT_CONFIG, getComparatorOptions(DEFAULT_CONFIG as any)),\n );\n}\n\n/**\n * Create a custom equality comparison method that handles circular references. This is very\n * similar to `createCustomEqual`, with the only difference being that `meta` expects to be\n * populated with a `WeakMap`-like contract.\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 * `WeakMap` out of the box.\n */\nexport function createCustomCircularEqual<\n Meta extends BaseCircularMeta = WeakMap<any, any>,\n>(getComparatorOptions: GetComparatorOptions<Meta>): EqualityComparator<Meta> {\n const comparator = createComparator<Meta>(\n merge(\n DEFAULT_CIRCULAR_CONFIG,\n getComparatorOptions(DEFAULT_CIRCULAR_CONFIG as any),\n ),\n );\n\n return ((a: any, b: any, meta: any = new WeakMap()) =>\n comparator(a, b, meta)) as EqualityComparator<Meta>;\n}\n"],"names":[],"mappings":";;;;;;EAMA;;;EAGG;EACG,SAAU,0BAA0B,CACxC,UAAoC,EAAA;EAEpC,IAAA,OAAO,SAAS,OAAO,CACrB,CAAI,EACJ,CAAI,EACJ,YAAiB,EACjB,YAAiB,EACjB,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EASG;EACG,SAAU,yBAAyB,CAEvC,oBAAgD,EAAA;EAChD,IAAA,IAAM,UAAU,GAAG,gBAAgB,CACjC,KAAK,CACH,uBAAuB,EACvB,oBAAoB,CAAC,uBAA8B,CAAC,CACrD,CACF,CAAC;EAEF,IAAA,QAAQ,UAAC,CAAM,EAAE,CAAM,EAAE,IAAyB,EAAA;UAAzB,IAAA,IAAA,KAAA,KAAA,CAAA,EAAA,EAAA,IAAgB,GAAA,IAAA,OAAO,EAAE,CAAA,EAAA;EAChD,QAAA,OAAA,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAA;EAAtB,KAAsB,EAA8B;EACxD;;;;;;;;;;;;;;;;"}
|
package/dist/fast-equals.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self)["fast-equals"]={})}(this,(function(e){"use strict";function r(e){return function(r,t,n,a,u,o,f){return e(r,t,f)}}function t(e){return function(r,t,n,a){if(!r||!t||"object"!=typeof r||"object"!=typeof t)return e(r,t,n,a);var u=a.get(r),o=a.get(t);if(u&&o)return u===t&&o===r;a.set(r,t),a.set(t,r);var f=e(r,t,n,a);return a.delete(r),a.delete(t),f}}function n(e,r){var t={};for(var n in e)t[n]=e[n];for(var n in r)t[n]=r[n];return t}function a(e){return e.constructor===Object||null==e.constructor}function u(e){return"function"==typeof e.then}function o(e,r){return e===r||e!=e&&r!=r}var f=Object.prototype.toString;function c(e){var r=e.areArraysEqual,t=e.areDatesEqual,n=e.areMapsEqual,c=e.areObjectsEqual,i=e.areRegExpsEqual,l=e.areSetsEqual,s=(0,e.createIsNestedEqual)(E);function E(e,E,p){if(e===E)return!0;if(!e||!E||"object"!=typeof e||"object"!=typeof E)return e!=e&&E!=E;if(a(e)&&a(E))return c(e,E,s,p);var q=Array.isArray(e),v=Array.isArray(E);if(q||v)return q===v&&r(e,E,s,p);var b=f.call(e);return b===f.call(E)&&("[object Date]"===b?t(e,E,s,p):"[object RegExp]"===b?i(e,E,s,p):"[object Map]"===b?n(e,E,s,p):"[object Set]"===b?l(e,E,s,p):"[object Object]"===b||"[object Arguments]"===b?!u(e)&&!u(E)&&c(e,E,s,p):("[object Boolean]"===b||"[object Number]"===b||"[object String]"===b)&&o(e.valueOf(),E.valueOf()))}return E}function i(e,r,t,n){var a=e.length;if(r.length!==a)return!1;for(;a-- >0;)if(!t(e[a],r[a],a,a,e,r,n))return!1;return!0}var l=t(i);function s(e,r){return o(e.valueOf(),r.valueOf())}function E(e,r,t,n){var a=e.size===r.size;if(!a)return!1;if(!e.size)return!0;var u={},o=0;return e.forEach((function(f,c){if(a){var i=!1,l=0;r.forEach((function(a,s){i||u[l]||!(i=t(c,s,o,l,e,r,n)&&t(f,a,c,s,e,r,n))||(u[l]=!0),l++})),o++,a=i}})),a}var p=t(E),q=Object.prototype.hasOwnProperty;function v(e,r,t,n){var a,u=Object.keys(e),o=u.length;if(Object.keys(r).length!==o)return!1;for(;o-- >0;){if("_owner"===(a=u[o])){var f=!!e.$$typeof,c=!!r.$$typeof;if((f||c)&&f!==c)return!1}if(!q.call(r,a)||!t(e[a],r[a],a,a,e,r,n))return!1}return!0}var b=t(v);function j(e,r){return e.source===r.source&&e.flags===r.flags}function y(e,r,t,n){var a=e.size===r.size;if(!a)return!1;if(!e.size)return!0;var u={};return e.forEach((function(o,f){if(a){var c=!1,i=0;r.forEach((function(a,l){c||u[i]||!(c=t(o,a,f,l,e,r,n))||(u[i]=!0),i++})),a=c}})),a}var d=t(y),g=Object.freeze({areArraysEqual:i,areDatesEqual:s,areMapsEqual:E,areObjectsEqual:v,areRegExpsEqual:j,areSetsEqual:y,createIsNestedEqual:r}),O=Object.freeze({areArraysEqual:l,areDatesEqual:s,areMapsEqual:p,areObjectsEqual:b,areRegExpsEqual:j,areSetsEqual:d,createIsNestedEqual:r}),h=c(g),z=c(n(g,{createIsNestedEqual:function(){return o}})),A=c(O),M=c(n(O,{createIsNestedEqual:function(){return o}}));e.circularDeepEqual=function(e,r){return A(e,r,new WeakMap)},e.circularShallowEqual=function(e,r){return M(e,r,new WeakMap)},e.createCustomCircularEqual=function(e){var r=c(n(O,e(O)));return function(e,t,n){return void 0===n&&(n=new WeakMap),r(e,t,n)}},e.createCustomEqual=function(e){return c(n(g,e(g)))},e.deepEqual=function(e,r){return h(e,r,void 0)},e.sameValueZeroEqual=o,e.shallowEqual=function(e,r){return z(e,r,void 0)},Object.defineProperty(e,"__esModule",{value:!0})}));
|