fast-equals 1.6.0 → 2.0.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/.release-it.beta.json +13 -0
- package/.release-it.json +9 -0
- package/.rpt2_cache/rpt2_3c5f4e5db6faf852c13e3cd5e0db7a72d0e60a69/code/cache/1d20cee756560ed06433a2e7dba9165f54487f2a +1 -0
- package/.rpt2_cache/rpt2_3c5f4e5db6faf852c13e3cd5e0db7a72d0e60a69/code/cache/cb395dc6899b78eb42b4fab9df67376a0a00bf80 +1 -0
- package/.rpt2_cache/rpt2_3c5f4e5db6faf852c13e3cd5e0db7a72d0e60a69/code/cache/d800d7a0e39da81c91ab9c5059068c29ebc83792 +1 -0
- package/.rpt2_cache/rpt2_3c5f4e5db6faf852c13e3cd5e0db7a72d0e60a69/semanticDiagnostics/cache/1d20cee756560ed06433a2e7dba9165f54487f2a +1 -0
- package/.rpt2_cache/rpt2_3c5f4e5db6faf852c13e3cd5e0db7a72d0e60a69/semanticDiagnostics/cache/cb395dc6899b78eb42b4fab9df67376a0a00bf80 +1 -0
- package/.rpt2_cache/rpt2_3c5f4e5db6faf852c13e3cd5e0db7a72d0e60a69/semanticDiagnostics/cache/d800d7a0e39da81c91ab9c5059068c29ebc83792 +1 -0
- package/.rpt2_cache/rpt2_3c5f4e5db6faf852c13e3cd5e0db7a72d0e60a69/syntacticDiagnostics/cache/1d20cee756560ed06433a2e7dba9165f54487f2a +1 -0
- package/.rpt2_cache/rpt2_3c5f4e5db6faf852c13e3cd5e0db7a72d0e60a69/syntacticDiagnostics/cache/cb395dc6899b78eb42b4fab9df67376a0a00bf80 +1 -0
- package/.rpt2_cache/rpt2_3c5f4e5db6faf852c13e3cd5e0db7a72d0e60a69/syntacticDiagnostics/cache/d800d7a0e39da81c91ab9c5059068c29ebc83792 +1 -0
- package/.rpt2_cache/rpt2_3c5f4e5db6faf852c13e3cd5e0db7a72d0e60a69/types/cache/c0f16c9111806a91c6ae4b5d0b138e4841adf7c9 +0 -0
- package/.rpt2_cache/rpt2_3c5f4e5db6faf852c13e3cd5e0db7a72d0e60a69/types/cache/c9f40676a1b140ebc96dde967251686b673a9961 +0 -0
- package/.rpt2_cache/rpt2_3c5f4e5db6faf852c13e3cd5e0db7a72d0e60a69/types/cache/e578d3be8d82631bd5cd8272d6aa5a54ba064304 +0 -0
- package/.rpt2_cache/rpt2_6a9ad0d85cd0ed74f9b918d742c78fdbe81d2201/code/cache/0ab301188498506f5c998a00679f29b8929634e4 +1 -0
- package/.rpt2_cache/rpt2_6a9ad0d85cd0ed74f9b918d742c78fdbe81d2201/code/cache/1d20cee756560ed06433a2e7dba9165f54487f2a +1 -0
- package/.rpt2_cache/rpt2_6a9ad0d85cd0ed74f9b918d742c78fdbe81d2201/code/cache/d800d7a0e39da81c91ab9c5059068c29ebc83792 +1 -0
- package/.rpt2_cache/rpt2_6a9ad0d85cd0ed74f9b918d742c78fdbe81d2201/semanticDiagnostics/cache/0ab301188498506f5c998a00679f29b8929634e4 +1 -0
- package/.rpt2_cache/rpt2_6a9ad0d85cd0ed74f9b918d742c78fdbe81d2201/semanticDiagnostics/cache/1d20cee756560ed06433a2e7dba9165f54487f2a +1 -0
- package/.rpt2_cache/rpt2_6a9ad0d85cd0ed74f9b918d742c78fdbe81d2201/semanticDiagnostics/cache/d800d7a0e39da81c91ab9c5059068c29ebc83792 +1 -0
- package/.rpt2_cache/rpt2_6a9ad0d85cd0ed74f9b918d742c78fdbe81d2201/syntacticDiagnostics/cache/0ab301188498506f5c998a00679f29b8929634e4 +1 -0
- package/.rpt2_cache/rpt2_6a9ad0d85cd0ed74f9b918d742c78fdbe81d2201/syntacticDiagnostics/cache/1d20cee756560ed06433a2e7dba9165f54487f2a +1 -0
- package/.rpt2_cache/rpt2_6a9ad0d85cd0ed74f9b918d742c78fdbe81d2201/syntacticDiagnostics/cache/d800d7a0e39da81c91ab9c5059068c29ebc83792 +1 -0
- package/.rpt2_cache/rpt2_6a9ad0d85cd0ed74f9b918d742c78fdbe81d2201/types/cache/6982fa2ac1e62f4aebb1debc73977393caa0d5a4 +0 -0
- package/.rpt2_cache/rpt2_6a9ad0d85cd0ed74f9b918d742c78fdbe81d2201/types/cache/c0f16c9111806a91c6ae4b5d0b138e4841adf7c9 +0 -0
- package/.rpt2_cache/rpt2_6a9ad0d85cd0ed74f9b918d742c78fdbe81d2201/types/cache/c9f40676a1b140ebc96dde967251686b673a9961 +0 -0
- package/.rpt2_cache/rpt2_6a9ad0d85cd0ed74f9b918d742c78fdbe81d2201/types/cache/e578d3be8d82631bd5cd8272d6aa5a54ba064304 +0 -0
- package/.rpt2_cache/rpt2_cbc4c616fc0ab8863b2f9b3be2cc7ae6306d679d/code/cache/82edcf6c99dc3d5802a5a8d3dbfc69f1048b520f +1 -0
- package/.rpt2_cache/rpt2_cbc4c616fc0ab8863b2f9b3be2cc7ae6306d679d/code/cache/eb02971c7d2972b89cd15754372a7b9a0b328a30 +1 -0
- package/.rpt2_cache/rpt2_cbc4c616fc0ab8863b2f9b3be2cc7ae6306d679d/code/cache/f6056671db45d89ddf3a27b7cf6d454993cec47b +1 -0
- package/.rpt2_cache/rpt2_cbc4c616fc0ab8863b2f9b3be2cc7ae6306d679d/semanticDiagnostics/cache/82edcf6c99dc3d5802a5a8d3dbfc69f1048b520f +1 -0
- package/.rpt2_cache/rpt2_cbc4c616fc0ab8863b2f9b3be2cc7ae6306d679d/semanticDiagnostics/cache/eb02971c7d2972b89cd15754372a7b9a0b328a30 +1 -0
- package/.rpt2_cache/rpt2_cbc4c616fc0ab8863b2f9b3be2cc7ae6306d679d/semanticDiagnostics/cache/f6056671db45d89ddf3a27b7cf6d454993cec47b +1 -0
- package/.rpt2_cache/rpt2_cbc4c616fc0ab8863b2f9b3be2cc7ae6306d679d/syntacticDiagnostics/cache/82edcf6c99dc3d5802a5a8d3dbfc69f1048b520f +1 -0
- package/.rpt2_cache/rpt2_cbc4c616fc0ab8863b2f9b3be2cc7ae6306d679d/syntacticDiagnostics/cache/eb02971c7d2972b89cd15754372a7b9a0b328a30 +1 -0
- package/.rpt2_cache/rpt2_cbc4c616fc0ab8863b2f9b3be2cc7ae6306d679d/syntacticDiagnostics/cache/f6056671db45d89ddf3a27b7cf6d454993cec47b +1 -0
- package/.rpt2_cache/rpt2_cbc4c616fc0ab8863b2f9b3be2cc7ae6306d679d/types/cache/c0f16c9111806a91c6ae4b5d0b138e4841adf7c9 +0 -0
- package/.rpt2_cache/rpt2_cbc4c616fc0ab8863b2f9b3be2cc7ae6306d679d/types/cache/c9f40676a1b140ebc96dde967251686b673a9961 +0 -0
- package/.rpt2_cache/rpt2_cbc4c616fc0ab8863b2f9b3be2cc7ae6306d679d/types/cache/e578d3be8d82631bd5cd8272d6aa5a54ba064304 +0 -0
- package/BUILD.md +37 -0
- package/CHANGELOG.md +39 -0
- package/README.md +69 -88
- package/dist/fast-equals.cjs.js +427 -0
- package/dist/fast-equals.cjs.js.map +1 -0
- package/dist/fast-equals.esm.js +418 -0
- package/dist/fast-equals.esm.js.map +1 -0
- package/dist/fast-equals.js +418 -11
- package/dist/fast-equals.js.map +1 -1
- package/dist/fast-equals.min.js +1 -1
- package/dist/fast-equals.mjs +418 -0
- package/dist/fast-equals.mjs.map +1 -0
- package/index.d.ts +15 -14
- package/package.json +52 -65
- package/es/comparator.js +0 -91
- package/es/constants.js +0 -14
- package/es/index.js +0 -23
- package/es/utils.js +0 -295
- package/es-to-mjs.js +0 -14
- package/lib/comparator.js +0 -97
- package/lib/constants.js +0 -17
- package/lib/index.js +0 -34
- package/lib/utils.js +0 -300
- package/mjs/comparator.mjs +0 -91
- package/mjs/constants.mjs +0 -14
- package/mjs/index.mjs +0 -23
- package/mjs/utils.mjs +0 -295
- package/rollup.config.js +0 -44
- package/yarn-error.log +0 -8175
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
var HAS_WEAKSET_SUPPORT = typeof WeakSet === 'function';
|
|
2
|
+
var keys = Object.keys;
|
|
3
|
+
/**
|
|
4
|
+
* @function addToCache
|
|
5
|
+
*
|
|
6
|
+
* add object to cache if an object
|
|
7
|
+
*
|
|
8
|
+
* @param value the value to potentially add to cache
|
|
9
|
+
* @param cache the cache to add to
|
|
10
|
+
*/
|
|
11
|
+
function addToCache(value, cache) {
|
|
12
|
+
if (value && typeof value === 'object') {
|
|
13
|
+
cache.add(value);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* @function hasPair
|
|
18
|
+
*
|
|
19
|
+
* @description
|
|
20
|
+
* does the `pairToMatch` exist in the list of `pairs` provided based on the
|
|
21
|
+
* `isEqual` check
|
|
22
|
+
*
|
|
23
|
+
* @param pairs the pairs to compare against
|
|
24
|
+
* @param pairToMatch the pair to match
|
|
25
|
+
* @param isEqual the equality comparator used
|
|
26
|
+
* @param meta the meta provided
|
|
27
|
+
* @returns does the pair exist in the pairs provided
|
|
28
|
+
*/
|
|
29
|
+
function hasPair(pairs, pairToMatch, isEqual, meta) {
|
|
30
|
+
var length = pairs.length;
|
|
31
|
+
var pair;
|
|
32
|
+
for (var index = 0; index < length; index++) {
|
|
33
|
+
pair = pairs[index];
|
|
34
|
+
if (isEqual(pair[0], pairToMatch[0], meta) &&
|
|
35
|
+
isEqual(pair[1], pairToMatch[1], meta)) {
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* @function hasValue
|
|
43
|
+
*
|
|
44
|
+
* @description
|
|
45
|
+
* does the `valueToMatch` exist in the list of `values` provided based on the
|
|
46
|
+
* `isEqual` check
|
|
47
|
+
*
|
|
48
|
+
* @param values the values to compare against
|
|
49
|
+
* @param valueToMatch the value to match
|
|
50
|
+
* @param isEqual the equality comparator used
|
|
51
|
+
* @param meta the meta provided
|
|
52
|
+
* @returns does the value exist in the values provided
|
|
53
|
+
*/
|
|
54
|
+
function hasValue(values, valueToMatch, isEqual, meta) {
|
|
55
|
+
var length = values.length;
|
|
56
|
+
for (var index = 0; index < length; index++) {
|
|
57
|
+
if (isEqual(values[index], valueToMatch, meta)) {
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* @function sameValueZeroEqual
|
|
65
|
+
*
|
|
66
|
+
* @description
|
|
67
|
+
* are the values passed strictly equal or both NaN
|
|
68
|
+
*
|
|
69
|
+
* @param a the value to compare against
|
|
70
|
+
* @param b the value to test
|
|
71
|
+
* @returns are the values equal by the SameValueZero principle
|
|
72
|
+
*/
|
|
73
|
+
function sameValueZeroEqual(a, b) {
|
|
74
|
+
return a === b || (a !== a && b !== b);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* @function isPlainObject
|
|
78
|
+
*
|
|
79
|
+
* @description
|
|
80
|
+
* is the value a plain object
|
|
81
|
+
*
|
|
82
|
+
* @param value the value to test
|
|
83
|
+
* @returns is the value a plain object
|
|
84
|
+
*/
|
|
85
|
+
function isPlainObject(value) {
|
|
86
|
+
return value.constructor === Object || value.constructor == null;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* @function isPromiseLike
|
|
90
|
+
*
|
|
91
|
+
* @description
|
|
92
|
+
* is the value promise-like (meaning it is thenable)
|
|
93
|
+
*
|
|
94
|
+
* @param value the value to test
|
|
95
|
+
* @returns is the value promise-like
|
|
96
|
+
*/
|
|
97
|
+
function isPromiseLike(value) {
|
|
98
|
+
return !!value && typeof value.then === 'function';
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* @function isReactElement
|
|
102
|
+
*
|
|
103
|
+
* @description
|
|
104
|
+
* is the value passed a react element
|
|
105
|
+
*
|
|
106
|
+
* @param value the value to test
|
|
107
|
+
* @returns is the value a react element
|
|
108
|
+
*/
|
|
109
|
+
function isReactElement(value) {
|
|
110
|
+
return !!(value && value.$$typeof);
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* @function getNewCacheFallback
|
|
114
|
+
*
|
|
115
|
+
* @description
|
|
116
|
+
* in cases where WeakSet is not supported, creates a new custom
|
|
117
|
+
* object that mimics the necessary API aspects for cache purposes
|
|
118
|
+
*
|
|
119
|
+
* @returns the new cache object
|
|
120
|
+
*/
|
|
121
|
+
function getNewCacheFallback() {
|
|
122
|
+
return Object.create({
|
|
123
|
+
_values: [],
|
|
124
|
+
add: function (value) {
|
|
125
|
+
this._values.push(value);
|
|
126
|
+
},
|
|
127
|
+
has: function (value) {
|
|
128
|
+
return this._values.indexOf(value) !== -1;
|
|
129
|
+
},
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* @function getNewCache
|
|
134
|
+
*
|
|
135
|
+
* @description
|
|
136
|
+
* get a new cache object to prevent circular references
|
|
137
|
+
*
|
|
138
|
+
* @returns the new cache object
|
|
139
|
+
*/
|
|
140
|
+
var getNewCache = (function (canUseWeakMap) {
|
|
141
|
+
if (canUseWeakMap) {
|
|
142
|
+
return function _getNewCache() {
|
|
143
|
+
return new WeakSet();
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
return getNewCacheFallback;
|
|
147
|
+
})(HAS_WEAKSET_SUPPORT);
|
|
148
|
+
/**
|
|
149
|
+
* @function createCircularEqualCreator
|
|
150
|
+
*
|
|
151
|
+
* @description
|
|
152
|
+
* create a custom isEqual handler specific to circular objects
|
|
153
|
+
*
|
|
154
|
+
* @param [isEqual] the isEqual comparator to use instead of isDeepEqual
|
|
155
|
+
* @returns the method to create the `isEqual` function
|
|
156
|
+
*/
|
|
157
|
+
function createCircularEqualCreator(isEqual) {
|
|
158
|
+
return function createCircularEqual(comparator) {
|
|
159
|
+
var _comparator = isEqual || comparator;
|
|
160
|
+
return function circularEqual(a, b, cache) {
|
|
161
|
+
if (cache === void 0) { cache = getNewCache(); }
|
|
162
|
+
var hasA = cache.has(a);
|
|
163
|
+
var hasB = cache.has(b);
|
|
164
|
+
if (hasA || hasB) {
|
|
165
|
+
return hasA && hasB;
|
|
166
|
+
}
|
|
167
|
+
addToCache(a, cache);
|
|
168
|
+
addToCache(b, cache);
|
|
169
|
+
return _comparator(a, b, cache);
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* @function toPairs
|
|
175
|
+
*
|
|
176
|
+
* @description
|
|
177
|
+
* convert the map passed into pairs (meaning an array of [key, value] tuples)
|
|
178
|
+
*
|
|
179
|
+
* @param map the map to convert to [key, value] pairs (entries)
|
|
180
|
+
* @returns the [key, value] pairs
|
|
181
|
+
*/
|
|
182
|
+
function toPairs(map) {
|
|
183
|
+
var pairs = new Array(map.size);
|
|
184
|
+
var index = 0;
|
|
185
|
+
map.forEach(function (value, key) {
|
|
186
|
+
pairs[index++] = [key, value];
|
|
187
|
+
});
|
|
188
|
+
return pairs;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* @function toValues
|
|
192
|
+
*
|
|
193
|
+
* @description
|
|
194
|
+
* convert the set passed into values
|
|
195
|
+
*
|
|
196
|
+
* @param set the set to convert to values
|
|
197
|
+
* @returns the values
|
|
198
|
+
*/
|
|
199
|
+
function toValues(set) {
|
|
200
|
+
var values = new Array(set.size);
|
|
201
|
+
var index = 0;
|
|
202
|
+
set.forEach(function (value) {
|
|
203
|
+
values[index++] = value;
|
|
204
|
+
});
|
|
205
|
+
return values;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* @function areArraysEqual
|
|
209
|
+
*
|
|
210
|
+
* @description
|
|
211
|
+
* are the arrays equal in value
|
|
212
|
+
*
|
|
213
|
+
* @param a the array to test
|
|
214
|
+
* @param b the array to test against
|
|
215
|
+
* @param isEqual the comparator to determine equality
|
|
216
|
+
* @param meta the meta object to pass through
|
|
217
|
+
* @returns are the arrays equal
|
|
218
|
+
*/
|
|
219
|
+
function areArraysEqual(a, b, isEqual, meta) {
|
|
220
|
+
var length = a.length;
|
|
221
|
+
if (b.length !== length) {
|
|
222
|
+
return false;
|
|
223
|
+
}
|
|
224
|
+
for (var index = 0; index < length; index++) {
|
|
225
|
+
if (!isEqual(a[index], b[index], meta)) {
|
|
226
|
+
return false;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
return true;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* @function areMapsEqual
|
|
233
|
+
*
|
|
234
|
+
* @description
|
|
235
|
+
* are the maps equal in value
|
|
236
|
+
*
|
|
237
|
+
* @param a the map to test
|
|
238
|
+
* @param b the map to test against
|
|
239
|
+
* @param isEqual the comparator to determine equality
|
|
240
|
+
* @param meta the meta map to pass through
|
|
241
|
+
* @returns are the maps equal
|
|
242
|
+
*/
|
|
243
|
+
function areMapsEqual(a, b, isEqual, meta) {
|
|
244
|
+
if (a.size !== b.size) {
|
|
245
|
+
return false;
|
|
246
|
+
}
|
|
247
|
+
var pairsA = toPairs(a);
|
|
248
|
+
var pairsB = toPairs(b);
|
|
249
|
+
var length = pairsA.length;
|
|
250
|
+
for (var index = 0; index < length; index++) {
|
|
251
|
+
if (!hasPair(pairsB, pairsA[index], isEqual, meta) ||
|
|
252
|
+
!hasPair(pairsA, pairsB[index], isEqual, meta)) {
|
|
253
|
+
return false;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
return true;
|
|
257
|
+
}
|
|
258
|
+
var OWNER = '_owner';
|
|
259
|
+
var hasOwnProperty = Function.prototype.bind.call(Function.prototype.call, Object.prototype.hasOwnProperty);
|
|
260
|
+
/**
|
|
261
|
+
* @function areObjectsEqual
|
|
262
|
+
*
|
|
263
|
+
* @description
|
|
264
|
+
* are the objects equal in value
|
|
265
|
+
*
|
|
266
|
+
* @param a the object to test
|
|
267
|
+
* @param b the object to test against
|
|
268
|
+
* @param isEqual the comparator to determine equality
|
|
269
|
+
* @param meta the meta object to pass through
|
|
270
|
+
* @returns are the objects equal
|
|
271
|
+
*/
|
|
272
|
+
function areObjectsEqual(a, b, isEqual, meta) {
|
|
273
|
+
var keysA = keys(a);
|
|
274
|
+
var length = keysA.length;
|
|
275
|
+
if (keys(b).length !== length) {
|
|
276
|
+
return false;
|
|
277
|
+
}
|
|
278
|
+
var key;
|
|
279
|
+
for (var index = 0; index < length; index++) {
|
|
280
|
+
key = keysA[index];
|
|
281
|
+
if (!hasOwnProperty(b, key)) {
|
|
282
|
+
return false;
|
|
283
|
+
}
|
|
284
|
+
if (key === OWNER && isReactElement(a)) {
|
|
285
|
+
if (!isReactElement(b)) {
|
|
286
|
+
return false;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
else if (!isEqual(a[key], b[key], meta)) {
|
|
290
|
+
return false;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
return true;
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* @function areRegExpsEqual
|
|
297
|
+
*
|
|
298
|
+
* @description
|
|
299
|
+
* are the regExps equal in value
|
|
300
|
+
*
|
|
301
|
+
* @param a the regExp to test
|
|
302
|
+
* @param b the regExp to test agains
|
|
303
|
+
* @returns are the regExps equal
|
|
304
|
+
*/
|
|
305
|
+
function areRegExpsEqual(a, b) {
|
|
306
|
+
return (a.source === b.source &&
|
|
307
|
+
a.global === b.global &&
|
|
308
|
+
a.ignoreCase === b.ignoreCase &&
|
|
309
|
+
a.multiline === b.multiline &&
|
|
310
|
+
a.unicode === b.unicode &&
|
|
311
|
+
a.sticky === b.sticky &&
|
|
312
|
+
a.lastIndex === b.lastIndex);
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* @function areSetsEqual
|
|
316
|
+
*
|
|
317
|
+
* @description
|
|
318
|
+
* are the sets equal in value
|
|
319
|
+
*
|
|
320
|
+
* @param a the set to test
|
|
321
|
+
* @param b the set to test against
|
|
322
|
+
* @param isEqual the comparator to determine equality
|
|
323
|
+
* @param meta the meta set to pass through
|
|
324
|
+
* @returns are the sets equal
|
|
325
|
+
*/
|
|
326
|
+
function areSetsEqual(a, b, isEqual, meta) {
|
|
327
|
+
if (a.size !== b.size) {
|
|
328
|
+
return false;
|
|
329
|
+
}
|
|
330
|
+
var valuesA = toValues(a);
|
|
331
|
+
var valuesB = toValues(b);
|
|
332
|
+
var length = valuesA.length;
|
|
333
|
+
for (var index = 0; index < length; index++) {
|
|
334
|
+
if (!hasValue(valuesB, valuesA[index], isEqual, meta) ||
|
|
335
|
+
!hasValue(valuesA, valuesB[index], isEqual, meta)) {
|
|
336
|
+
return false;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
return true;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
var isArray = Array.isArray;
|
|
343
|
+
var HAS_MAP_SUPPORT = typeof Map === 'function';
|
|
344
|
+
var HAS_SET_SUPPORT = typeof Set === 'function';
|
|
345
|
+
var OBJECT_TYPEOF = 'object';
|
|
346
|
+
function createComparator(createIsEqual) {
|
|
347
|
+
var isEqual =
|
|
348
|
+
/* eslint-disable no-use-before-define */
|
|
349
|
+
typeof createIsEqual === 'function'
|
|
350
|
+
? createIsEqual(comparator)
|
|
351
|
+
: comparator;
|
|
352
|
+
/* eslint-enable */
|
|
353
|
+
/**
|
|
354
|
+
* @function comparator
|
|
355
|
+
*
|
|
356
|
+
* @description
|
|
357
|
+
* compare the value of the two objects and return true if they are equivalent in values
|
|
358
|
+
*
|
|
359
|
+
* @param a the value to test against
|
|
360
|
+
* @param b the value to test
|
|
361
|
+
* @param [meta] an optional meta object that is passed through to all equality test calls
|
|
362
|
+
* @returns are a and b equivalent in value
|
|
363
|
+
*/
|
|
364
|
+
function comparator(a, b, meta) {
|
|
365
|
+
if (sameValueZeroEqual(a, b)) {
|
|
366
|
+
return true;
|
|
367
|
+
}
|
|
368
|
+
if (a && b && typeof a === OBJECT_TYPEOF && typeof b === OBJECT_TYPEOF) {
|
|
369
|
+
if (isPlainObject(a) && isPlainObject(b)) {
|
|
370
|
+
return areObjectsEqual(a, b, isEqual, meta);
|
|
371
|
+
}
|
|
372
|
+
var arrayA = isArray(a);
|
|
373
|
+
var arrayB = isArray(b);
|
|
374
|
+
if (arrayA || arrayB) {
|
|
375
|
+
return arrayA === arrayB && areArraysEqual(a, b, isEqual, meta);
|
|
376
|
+
}
|
|
377
|
+
var aDate = a instanceof Date;
|
|
378
|
+
var bDate = b instanceof Date;
|
|
379
|
+
if (aDate || bDate) {
|
|
380
|
+
return aDate === bDate && sameValueZeroEqual(a.getTime(), b.getTime());
|
|
381
|
+
}
|
|
382
|
+
var aRegExp = a instanceof RegExp;
|
|
383
|
+
var bRegExp = b instanceof RegExp;
|
|
384
|
+
if (aRegExp || bRegExp) {
|
|
385
|
+
return aRegExp === bRegExp && areRegExpsEqual(a, b);
|
|
386
|
+
}
|
|
387
|
+
if (isPromiseLike(a) || isPromiseLike(b)) {
|
|
388
|
+
return a === b;
|
|
389
|
+
}
|
|
390
|
+
if (HAS_MAP_SUPPORT) {
|
|
391
|
+
var aMap = a instanceof Map;
|
|
392
|
+
var bMap = b instanceof Map;
|
|
393
|
+
if (aMap || bMap) {
|
|
394
|
+
return aMap === bMap && areMapsEqual(a, b, isEqual, meta);
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
if (HAS_SET_SUPPORT) {
|
|
398
|
+
var aSet = a instanceof Set;
|
|
399
|
+
var bSet = b instanceof Set;
|
|
400
|
+
if (aSet || bSet) {
|
|
401
|
+
return aSet === bSet && areSetsEqual(a, b, isEqual, meta);
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
return areObjectsEqual(a, b, isEqual, meta);
|
|
405
|
+
}
|
|
406
|
+
return false;
|
|
407
|
+
}
|
|
408
|
+
return comparator;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
// comparator
|
|
412
|
+
var deepEqual = createComparator();
|
|
413
|
+
var shallowEqual = createComparator(function () { return sameValueZeroEqual; });
|
|
414
|
+
var circularDeepEqual = createComparator(createCircularEqualCreator());
|
|
415
|
+
var circularShallowEqual = createComparator(createCircularEqualCreator(sameValueZeroEqual));
|
|
416
|
+
|
|
417
|
+
export { circularDeepEqual, circularShallowEqual, createComparator as createCustomEqual, deepEqual, sameValueZeroEqual, shallowEqual };
|
|
418
|
+
//# sourceMappingURL=fast-equals.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fast-equals.esm.js","sources":["../src/utils.ts","../src/comparator.ts","../src/index.ts"],"sourcesContent":["const HAS_WEAKSET_SUPPORT = typeof WeakSet === 'function';\n\nconst { keys } = Object;\n\ntype Cache = {\n add: (value: any) => void;\n has: (value: any) => boolean;\n};\n\n/**\n * @function addToCache\n *\n * add object to cache if an object\n *\n * @param value the value to potentially add to cache\n * @param cache the cache to add to\n */\nexport function addToCache(value: any, cache: Cache) {\n if (value && typeof value === 'object') {\n cache.add(value);\n }\n}\n\nexport type EqualityComparator = (a: any, b: any, meta?: any) => boolean;\n\n/**\n * @function hasPair\n *\n * @description\n * does the `pairToMatch` exist in the list of `pairs` provided based on the\n * `isEqual` check\n *\n * @param pairs the pairs to compare against\n * @param pairToMatch the pair to match\n * @param isEqual the equality comparator used\n * @param meta the meta provided\n * @returns does the pair exist in the pairs provided\n */\nexport function hasPair(\n pairs: [any, any][],\n pairToMatch: [any, any],\n isEqual: EqualityComparator,\n meta: any,\n) {\n const { length } = pairs;\n\n let pair: [any, any];\n\n for (let index = 0; index < length; index++) {\n pair = pairs[index];\n\n if (\n isEqual(pair[0], pairToMatch[0], meta) &&\n isEqual(pair[1], pairToMatch[1], meta)\n ) {\n return true;\n }\n }\n\n return false;\n}\n\n/**\n * @function hasValue\n *\n * @description\n * does the `valueToMatch` exist in the list of `values` provided based on the\n * `isEqual` check\n *\n * @param values the values to compare against\n * @param valueToMatch the value to match\n * @param isEqual the equality comparator used\n * @param meta the meta provided\n * @returns does the value exist in the values provided\n */\nexport function hasValue(\n values: any[],\n valueToMatch: any,\n isEqual: EqualityComparator,\n meta: any,\n) {\n const { length } = values;\n\n for (let index = 0; index < length; index++) {\n if (isEqual(values[index], valueToMatch, meta)) {\n return true;\n }\n }\n\n return false;\n}\n\n/**\n * @function sameValueZeroEqual\n *\n * @description\n * are the values passed strictly equal or both NaN\n *\n * @param a the value to compare against\n * @param b the value to test\n * @returns are the values equal by the SameValueZero principle\n */\nexport function sameValueZeroEqual(a: any, b: any) {\n return a === b || (a !== a && b !== b);\n}\n\n/**\n * @function isPlainObject\n *\n * @description\n * is the value a plain object\n *\n * @param value the value to test\n * @returns is the value a plain object\n */\nexport function isPlainObject(value: any) {\n return value.constructor === Object || value.constructor == null;\n}\n\n/**\n * @function isPromiseLike\n *\n * @description\n * is the value promise-like (meaning it is thenable)\n *\n * @param value the value to test\n * @returns is the value promise-like\n */\nexport function isPromiseLike(value: any) {\n return !!value && typeof value.then === 'function';\n}\n\n/**\n * @function isReactElement\n *\n * @description\n * is the value passed a react element\n *\n * @param value the value to test\n * @returns is the value a react element\n */\nexport function isReactElement(value: any) {\n return !!(value && value.$$typeof);\n}\n\n/**\n * @function getNewCacheFallback\n *\n * @description\n * in cases where WeakSet is not supported, creates a new custom\n * object that mimics the necessary API aspects for cache purposes\n *\n * @returns the new cache object\n */\nexport function getNewCacheFallback(): Cache {\n return Object.create({\n _values: [],\n\n add(value: any) {\n this._values.push(value);\n },\n\n has(value: any) {\n return this._values.indexOf(value) !== -1;\n },\n });\n}\n\n/**\n * @function getNewCache\n *\n * @description\n * get a new cache object to prevent circular references\n *\n * @returns the new cache object\n */\nexport const getNewCache = ((canUseWeakMap: boolean) => {\n if (canUseWeakMap) {\n return function _getNewCache(): Cache {\n return new WeakSet();\n };\n }\n\n return getNewCacheFallback;\n})(HAS_WEAKSET_SUPPORT);\n\n/**\n * @function createCircularEqualCreator\n *\n * @description\n * create a custom isEqual handler specific to circular objects\n *\n * @param [isEqual] the isEqual comparator to use instead of isDeepEqual\n * @returns the method to create the `isEqual` function\n */\nexport function createCircularEqualCreator(isEqual?: EqualityComparator) {\n return function createCircularEqual(comparator: EqualityComparator) {\n const _comparator = isEqual || comparator;\n\n return function circularEqual(\n a: any,\n b: any,\n cache: Cache = getNewCache(),\n ) {\n const hasA = cache.has(a);\n const hasB = cache.has(b);\n\n if (hasA || hasB) {\n return hasA && hasB;\n }\n\n addToCache(a, cache);\n addToCache(b, cache);\n\n return _comparator(a, b, cache);\n };\n };\n}\n\n/**\n * @function toPairs\n *\n * @description\n * convert the map passed into pairs (meaning an array of [key, value] tuples)\n *\n * @param map the map to convert to [key, value] pairs (entries)\n * @returns the [key, value] pairs\n */\nexport function toPairs(map: Map<any, any>): [any, any][] {\n const pairs = new Array(map.size);\n\n let index = 0;\n\n map.forEach((value, key) => {\n pairs[index++] = [key, value];\n });\n\n return pairs;\n}\n\n/**\n * @function toValues\n *\n * @description\n * convert the set passed into values\n *\n * @param set the set to convert to values\n * @returns the values\n */\nexport function toValues(set: Set<any>) {\n const values = new Array(set.size);\n\n let index = 0;\n\n set.forEach((value) => {\n values[index++] = value;\n });\n\n return values;\n}\n\n/**\n * @function areArraysEqual\n *\n * @description\n * are the arrays equal in value\n *\n * @param a the array to test\n * @param b the array to test against\n * @param isEqual the comparator to determine equality\n * @param meta the meta object to pass through\n * @returns are the arrays equal\n */\nexport function areArraysEqual(\n a: any[],\n b: any[],\n isEqual: EqualityComparator,\n meta: any,\n) {\n const { length } = a;\n\n if (b.length !== length) {\n return false;\n }\n\n for (let index = 0; index < length; index++) {\n if (!isEqual(a[index], b[index], meta)) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * @function areMapsEqual\n *\n * @description\n * are the maps equal in value\n *\n * @param a the map to test\n * @param b the map to test against\n * @param isEqual the comparator to determine equality\n * @param meta the meta map to pass through\n * @returns are the maps equal\n */\nexport function areMapsEqual(\n a: Map<any, any>,\n b: Map<any, any>,\n isEqual: EqualityComparator,\n meta: any,\n) {\n if (a.size !== b.size) {\n return false;\n }\n\n const pairsA = toPairs(a);\n const pairsB = toPairs(b);\n\n const { length } = pairsA;\n\n for (let index = 0; index < length; index++) {\n if (\n !hasPair(pairsB, pairsA[index], isEqual, meta) ||\n !hasPair(pairsA, pairsB[index], isEqual, meta)\n ) {\n return false;\n }\n }\n\n return true;\n}\n\ntype Dictionary<Type> = {\n [key: string]: Type;\n [index: number]: Type;\n};\n\nconst OWNER = '_owner';\n\nconst hasOwnProperty = Function.prototype.bind.call(\n Function.prototype.call,\n Object.prototype.hasOwnProperty,\n);\n\n/**\n * @function areObjectsEqual\n *\n * @description\n * are the objects equal in value\n *\n * @param a the object to test\n * @param b the object to test against\n * @param isEqual the comparator to determine equality\n * @param meta the meta object to pass through\n * @returns are the objects equal\n */\nexport function areObjectsEqual(\n a: Dictionary<any>,\n b: Dictionary<any>,\n isEqual: EqualityComparator,\n meta: any,\n) {\n const keysA = keys(a);\n\n const { length } = keysA;\n\n if (keys(b).length !== length) {\n return false;\n }\n\n let key: string;\n\n for (let index = 0; index < length; index++) {\n key = keysA[index];\n\n if (!hasOwnProperty(b, key)) {\n return false;\n }\n\n if (key === OWNER && isReactElement(a)) {\n if (!isReactElement(b)) {\n return false;\n }\n } else if (!isEqual(a[key], b[key], meta)) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * @function areRegExpsEqual\n *\n * @description\n * are the regExps equal in value\n *\n * @param a the regExp to test\n * @param b the regExp to test agains\n * @returns are the regExps equal\n */\nexport function areRegExpsEqual(a: RegExp, b: RegExp) {\n return (\n a.source === b.source &&\n a.global === b.global &&\n a.ignoreCase === b.ignoreCase &&\n a.multiline === b.multiline &&\n a.unicode === b.unicode &&\n a.sticky === b.sticky &&\n a.lastIndex === b.lastIndex\n );\n}\n\n/**\n * @function areSetsEqual\n *\n * @description\n * are the sets equal in value\n *\n * @param a the set to test\n * @param b the set to test against\n * @param isEqual the comparator to determine equality\n * @param meta the meta set to pass through\n * @returns are the sets equal\n */\nexport function areSetsEqual(\n a: Set<any>,\n b: Set<any>,\n isEqual: EqualityComparator,\n meta: any,\n) {\n if (a.size !== b.size) {\n return false;\n }\n\n const valuesA = toValues(a);\n const valuesB = toValues(b);\n\n const { length } = valuesA;\n\n for (let index = 0; index < length; index++) {\n if (\n !hasValue(valuesB, valuesA[index], isEqual, meta) ||\n !hasValue(valuesA, valuesB[index], isEqual, meta)\n ) {\n return false;\n }\n }\n\n return true;\n}\n","import {\n EqualityComparator,\n areArraysEqual,\n areMapsEqual,\n areObjectsEqual,\n areRegExpsEqual,\n areSetsEqual,\n isPlainObject,\n isPromiseLike,\n sameValueZeroEqual,\n} from './utils';\n\nconst { isArray } = Array;\n\nconst HAS_MAP_SUPPORT = typeof Map === 'function';\nconst HAS_SET_SUPPORT = typeof Set === 'function';\n\nconst OBJECT_TYPEOF = 'object';\n\ntype EqualityComparatorCreator = (fn: EqualityComparator) => EqualityComparator;\n\nexport function createComparator(createIsEqual?: EqualityComparatorCreator) {\n const isEqual: EqualityComparator =\n /* eslint-disable no-use-before-define */\n typeof createIsEqual === 'function'\n ? createIsEqual(comparator)\n : comparator;\n /* eslint-enable */\n\n /**\n * @function comparator\n *\n * @description\n * compare the value of the two objects and return true if they are equivalent in values\n *\n * @param a the value to test against\n * @param b the value to test\n * @param [meta] an optional meta object that is passed through to all equality test calls\n * @returns are a and b equivalent in value\n */\n function comparator(a: any, b: any, meta?: any) {\n if (sameValueZeroEqual(a, b)) {\n return true;\n }\n\n if (a && b && typeof a === OBJECT_TYPEOF && typeof b === OBJECT_TYPEOF) {\n if (isPlainObject(a) && isPlainObject(b)) {\n return areObjectsEqual(a, b, isEqual, meta);\n }\n\n const arrayA = isArray(a);\n const arrayB = isArray(b);\n\n if (arrayA || arrayB) {\n return arrayA === arrayB && areArraysEqual(a, b, isEqual, meta);\n }\n\n const aDate = a instanceof Date;\n const bDate = b instanceof Date;\n\n if (aDate || bDate) {\n return aDate === bDate && sameValueZeroEqual(a.getTime(), b.getTime());\n }\n\n const aRegExp = a instanceof RegExp;\n const bRegExp = b instanceof RegExp;\n\n if (aRegExp || bRegExp) {\n return aRegExp === bRegExp && areRegExpsEqual(a, b);\n }\n\n if (isPromiseLike(a) || isPromiseLike(b)) {\n return a === b;\n }\n\n if (HAS_MAP_SUPPORT) {\n const aMap = a instanceof Map;\n const bMap = b instanceof Map;\n\n if (aMap || bMap) {\n return aMap === bMap && areMapsEqual(a, b, isEqual, meta);\n }\n }\n\n if (HAS_SET_SUPPORT) {\n const aSet = a instanceof Set;\n const bSet = b instanceof Set;\n\n if (aSet || bSet) {\n return aSet === bSet && areSetsEqual(a, b, isEqual, meta);\n }\n }\n\n return areObjectsEqual(a, b, isEqual, meta);\n }\n\n return false;\n }\n\n return comparator;\n}\n","// comparator\nimport { createComparator } from './comparator';\n\n// utils\nimport { createCircularEqualCreator, sameValueZeroEqual } from './utils';\n\nexport { createComparator as createCustomEqual, sameValueZeroEqual };\n\nexport const deepEqual = createComparator();\nexport const shallowEqual = createComparator(() => sameValueZeroEqual);\n\nexport const circularDeepEqual = createComparator(createCircularEqualCreator());\nexport const circularShallowEqual = createComparator(\n createCircularEqualCreator(sameValueZeroEqual),\n);\n"],"names":[],"mappings":"AAAA,IAAM,mBAAmB,GAAG,OAAO,OAAO,KAAK,UAAU,CAAC;AAElD,IAAA,kBAAI,CAAY;;;;;;;;;AAexB,SAAgB,UAAU,CAAC,KAAU,EAAE,KAAY;IACjD,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QACtC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;KAClB;CACF;;;;;;;;;;;;;;AAiBD,SAAgB,OAAO,CACrB,KAAmB,EACnB,WAAuB,EACvB,OAA2B,EAC3B,IAAS;IAED,IAAA,qBAAM,CAAW;IAEzB,IAAI,IAAgB,CAAC;IAErB,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,EAAE,KAAK,EAAE,EAAE;QAC3C,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;QAEpB,IACE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,IAA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