fast-equals 6.0.0 → 6.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -415,73 +415,78 @@ All benchmarks were performed on an i9-11900H Ubuntu Linux 24.04 laptop with 64G
415
415
  - A mixed object with a combination of all the above types
416
416
 
417
417
  ```bash
418
+ Testing mixed objects equal...
418
419
  ┌────────────────────────────────────────┬────────────────┐
419
420
  │ Name │ Ops / sec │
420
421
  ├────────────────────────────────────────┼────────────────┤
421
- │ fast-equals (passed) │ 1544237.29413
422
+ │ fast-equals (passed) │ 1478330.935014
422
423
  ├────────────────────────────────────────┼────────────────┤
423
- │ fast-deep-equal (passed) │ 1328583.767745
424
+ │ fast-deep-equal (passed) │ 1246644.004889
424
425
  ├────────────────────────────────────────┼────────────────┤
425
- │ react-fast-compare (passed) │ 1301727.296375
426
+ │ react-fast-compare (passed) │ 1223991.602206
426
427
  ├────────────────────────────────────────┼────────────────┤
427
- │ shallow-equal-fuzzy (passed) │ 1225981.400919
428
+ │ shallow-equal-fuzzy (passed) │ 1192746.28367
428
429
  ├────────────────────────────────────────┼────────────────┤
429
- │ nano-equal (failed) │ 969495.538753
430
+ │ nano-equal (failed) │ 917825.058845
430
431
  ├────────────────────────────────────────┼────────────────┤
431
- │ fast-equals (circular) (passed) │ 813716.49516
432
+ │ fast-equals (circular) (passed) │ 734269.031473
432
433
  ├────────────────────────────────────────┼────────────────┤
433
- │ dequal/lite (passed) │ 780805.627339
434
+ │ dequal/lite (passed) │ 702632.334945
434
435
  ├────────────────────────────────────────┼────────────────┤
435
- │ dequal (passed) │ 767208.995048
436
+ │ dequal (passed) │ 676206.685725
436
437
  ├────────────────────────────────────────┼────────────────┤
437
- │ underscore.isEqual (passed) │ 490695.830468
438
+ │ underscore.isEqual (passed) │ 413859.810046
438
439
  ├────────────────────────────────────────┼────────────────┤
439
- │ assert.deepStrictEqual (passed) │ 471011.425391
440
+ │ assert.deepStrictEqual (passed) │ 384573.330742
440
441
  ├────────────────────────────────────────┼────────────────┤
441
- lodash.isEqual (passed) 296064.057382
442
+ es-toolkit (passed) 333634.454044
442
443
  ├────────────────────────────────────────┼────────────────┤
443
- │ fast-equals (strict) (passed) │ 225894.800964
444
+ │ fast-equals (strict) (passed) │ 285124.652706
444
445
  ├────────────────────────────────────────┼────────────────┤
445
- fast-equals (strict circular) (passed) 195657.732354
446
+ lodash.isEqual (passed) 272221.340481
446
447
  ├────────────────────────────────────────┼────────────────┤
447
- deep-eql (passed) 162718.102328
448
+ fast-equals (strict circular) (passed) 236878.960045
448
449
  ├────────────────────────────────────────┼────────────────┤
449
- │ deep-equal (passed) 954.172311
450
+ │ deep-eql (passed) 154390.610864
451
+ ├────────────────────────────────────────┼────────────────┤
452
+ │ deep-equal (passed) │ 905.343563 │
450
453
  └────────────────────────────────────────┴────────────────┘
451
454
 
452
455
  Testing mixed objects not equal...
453
456
  ┌────────────────────────────────────────┬────────────────┐
454
457
  │ Name │ Ops / sec │
455
458
  ├────────────────────────────────────────┼────────────────┤
456
- │ fast-equals (passed) │ 5112341.000979
459
+ │ fast-equals (passed) │ 4962887.909706
460
+ ├────────────────────────────────────────┼────────────────┤
461
+ │ fast-equals (circular) (passed) │ 3362453.019363 │
457
462
  ├────────────────────────────────────────┼────────────────┤
458
- │ fast-equals (circular) (passed) 3501225.300307
463
+ │ fast-deep-equal (passed) 3359178.728738
459
464
  ├────────────────────────────────────────┼────────────────┤
460
- │ fast-deep-equal (passed) 3471838.735181
465
+ react-fast-compare (passed) 3240226.145634
461
466
  ├────────────────────────────────────────┼────────────────┤
462
- react-fast-compare (passed) 3439612.908273
467
+ │ fast-equals (strict) (passed) 2895230.420069
463
468
  ├────────────────────────────────────────┼────────────────┤
464
- │ fast-equals (strict) (passed) 1797319.423491
469
+ │ fast-equals (strict circular) (passed) 2178891.848559
465
470
  ├────────────────────────────────────────┼────────────────┤
466
- fast-equals (strict circular) (passed) 1534168.229167
471
+ dequal/lite (passed) 1271343.172786
467
472
  ├────────────────────────────────────────┼────────────────┤
468
- │ dequal/lite (passed) 1357981.758571
473
+ │ dequal (passed) 1249090.305916
469
474
  ├────────────────────────────────────────┼────────────────┤
470
- dequal (passed) 1328078.173967
475
+ shallow-equal-fuzzy (failed) 1197792.018762
471
476
  ├────────────────────────────────────────┼────────────────┤
472
- shallow-equal-fuzzy (failed) 1224747.272118
477
+ nano-equal (passed) 1041772.816799
473
478
  ├────────────────────────────────────────┼────────────────┤
474
- nano-equal (passed) 1087373.99615
479
+ underscore.isEqual (passed) 642874.802948
475
480
  ├────────────────────────────────────────┼────────────────┤
476
- underscore.isEqual (passed) 927298.592729
481
+ lodash.isEqual (passed) 360803.14264
477
482
  ├────────────────────────────────────────┼────────────────┤
478
- lodash.isEqual (passed) 387294.235476
483
+ es-toolkit (passed) 353678.240503
479
484
  ├────────────────────────────────────────┼────────────────┤
480
- │ deep-eql (passed) │ 186028.168827
485
+ │ deep-eql (passed) │ 177224.890296
481
486
  ├────────────────────────────────────────┼────────────────┤
482
- │ assert.deepStrictEqual (passed) │ 21261.312424
487
+ │ assert.deepStrictEqual (passed) │ 19507.749026
483
488
  ├────────────────────────────────────────┼────────────────┤
484
- │ deep-equal (passed) │ 3782.329948
489
+ │ deep-equal (passed) │ 3559.100155
485
490
  └────────────────────────────────────────┴────────────────┘
486
491
  ```
487
492
 
@@ -40,7 +40,10 @@ function createIsCircular(areItemsEqual) {
40
40
  * not enumerable and symbol properties.
41
41
  */
42
42
  function getStrictProperties(object) {
43
- return getOwnPropertyNames(object).concat(getOwnPropertySymbols(object));
43
+ const symbols = getOwnPropertySymbols(object);
44
+ return symbols.length
45
+ ? getOwnPropertyNames(object).concat(symbols)
46
+ : getOwnPropertyNames(object);
44
47
  }
45
48
  /**
46
49
  * Whether the object contains the property passed as an own property.
@@ -138,7 +141,7 @@ function areMapsEqual(a, b, state) {
138
141
  if (!size) {
139
142
  return true;
140
143
  }
141
- const matchedIndices = new Array(size);
144
+ const matchedIndices = new Uint8Array(size);
142
145
  const aIterable = a.entries();
143
146
  let aResult;
144
147
  let bResult;
@@ -149,7 +152,7 @@ function areMapsEqual(a, b, state) {
149
152
  break;
150
153
  }
151
154
  const bIterable = b.entries();
152
- let hasMatch = false;
155
+ let hasMatch = 0;
153
156
  let matchIndex = 0;
154
157
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
155
158
  while ((bResult = bIterable.next())) {
@@ -164,7 +167,7 @@ function areMapsEqual(a, b, state) {
164
167
  const bEntry = bResult.value;
165
168
  if (state.equals(aEntry[0], bEntry[0], index, matchIndex, a, b, state)
166
169
  && state.equals(aEntry[1], bEntry[1], aEntry[0], bEntry[0], a, b, state)) {
167
- hasMatch = matchedIndices[matchIndex] = true;
170
+ hasMatch = matchedIndices[matchIndex] = 1;
168
171
  break;
169
172
  }
170
173
  matchIndex++;
@@ -253,7 +256,7 @@ function areSetsEqual(a, b, state) {
253
256
  if (!size) {
254
257
  return true;
255
258
  }
256
- const matchedIndices = new Array(size);
259
+ const matchedIndices = new Uint8Array(size);
257
260
  const aIterable = a.values();
258
261
  let aResult;
259
262
  let bResult;
@@ -263,7 +266,7 @@ function areSetsEqual(a, b, state) {
263
266
  break;
264
267
  }
265
268
  const bIterable = b.values();
266
- let hasMatch = false;
269
+ let hasMatch = 0;
267
270
  let matchIndex = 0;
268
271
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
269
272
  while ((bResult = bIterable.next())) {
@@ -272,7 +275,7 @@ function areSetsEqual(a, b, state) {
272
275
  }
273
276
  if (!matchedIndices[matchIndex]
274
277
  && state.equals(aResult.value, bResult.value, aResult.value, bResult.value, a, b, state)) {
275
- hasMatch = matchedIndices[matchIndex] = true;
278
+ hasMatch = matchedIndices[matchIndex] = 1;
276
279
  break;
277
280
  }
278
281
  matchIndex++;
@@ -287,8 +290,8 @@ function areSetsEqual(a, b, state) {
287
290
  * Whether the TypedArray instances are equal in value.
288
291
  */
289
292
  function areTypedArraysEqual(a, b) {
290
- let index = a.byteLength;
291
- if (b.byteLength !== index || a.byteOffset !== b.byteOffset) {
293
+ let index = a.length;
294
+ if (b.length !== index || a.byteOffset !== b.byteOffset) {
292
295
  return false;
293
296
  }
294
297
  while (index-- > 0) {
package/dist/es/index.mjs CHANGED
@@ -38,7 +38,10 @@ function createIsCircular(areItemsEqual) {
38
38
  * not enumerable and symbol properties.
39
39
  */
40
40
  function getStrictProperties(object) {
41
- return getOwnPropertyNames(object).concat(getOwnPropertySymbols(object));
41
+ const symbols = getOwnPropertySymbols(object);
42
+ return symbols.length
43
+ ? getOwnPropertyNames(object).concat(symbols)
44
+ : getOwnPropertyNames(object);
42
45
  }
43
46
  /**
44
47
  * Whether the object contains the property passed as an own property.
@@ -136,7 +139,7 @@ function areMapsEqual(a, b, state) {
136
139
  if (!size) {
137
140
  return true;
138
141
  }
139
- const matchedIndices = new Array(size);
142
+ const matchedIndices = new Uint8Array(size);
140
143
  const aIterable = a.entries();
141
144
  let aResult;
142
145
  let bResult;
@@ -147,7 +150,7 @@ function areMapsEqual(a, b, state) {
147
150
  break;
148
151
  }
149
152
  const bIterable = b.entries();
150
- let hasMatch = false;
153
+ let hasMatch = 0;
151
154
  let matchIndex = 0;
152
155
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
153
156
  while ((bResult = bIterable.next())) {
@@ -162,7 +165,7 @@ function areMapsEqual(a, b, state) {
162
165
  const bEntry = bResult.value;
163
166
  if (state.equals(aEntry[0], bEntry[0], index, matchIndex, a, b, state)
164
167
  && state.equals(aEntry[1], bEntry[1], aEntry[0], bEntry[0], a, b, state)) {
165
- hasMatch = matchedIndices[matchIndex] = true;
168
+ hasMatch = matchedIndices[matchIndex] = 1;
166
169
  break;
167
170
  }
168
171
  matchIndex++;
@@ -251,7 +254,7 @@ function areSetsEqual(a, b, state) {
251
254
  if (!size) {
252
255
  return true;
253
256
  }
254
- const matchedIndices = new Array(size);
257
+ const matchedIndices = new Uint8Array(size);
255
258
  const aIterable = a.values();
256
259
  let aResult;
257
260
  let bResult;
@@ -261,7 +264,7 @@ function areSetsEqual(a, b, state) {
261
264
  break;
262
265
  }
263
266
  const bIterable = b.values();
264
- let hasMatch = false;
267
+ let hasMatch = 0;
265
268
  let matchIndex = 0;
266
269
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
267
270
  while ((bResult = bIterable.next())) {
@@ -270,7 +273,7 @@ function areSetsEqual(a, b, state) {
270
273
  }
271
274
  if (!matchedIndices[matchIndex]
272
275
  && state.equals(aResult.value, bResult.value, aResult.value, bResult.value, a, b, state)) {
273
- hasMatch = matchedIndices[matchIndex] = true;
276
+ hasMatch = matchedIndices[matchIndex] = 1;
274
277
  break;
275
278
  }
276
279
  matchIndex++;
@@ -285,8 +288,8 @@ function areSetsEqual(a, b, state) {
285
288
  * Whether the TypedArray instances are equal in value.
286
289
  */
287
290
  function areTypedArraysEqual(a, b) {
288
- let index = a.byteLength;
289
- if (b.byteLength !== index || a.byteOffset !== b.byteOffset) {
291
+ let index = a.length;
292
+ if (b.length !== index || a.byteOffset !== b.byteOffset) {
290
293
  return false;
291
294
  }
292
295
  while (index-- > 0) {
package/package.json CHANGED
@@ -9,40 +9,41 @@
9
9
  },
10
10
  "description": "A blazing-fast equality comparison utility for a variety of use-cases",
11
11
  "devDependencies": {
12
- "@planttheidea/build-tools": "^2.0.0",
13
- "@types/lodash": "^4.17.21",
14
- "@types/node": "^24.10.4",
15
- "@types/ramda": "^0.31.1",
16
- "@types/react": "^19.2.7",
12
+ "@planttheidea/build-tools": "^2.0.2",
13
+ "@types/lodash": "^4.17.24",
14
+ "@types/node": "^24.13.3",
15
+ "@types/ramda": "^0.32.0",
16
+ "@types/react": "^19.2.17",
17
17
  "@types/react-dom": "^19.2.3",
18
- "@typescript-eslint/eslint-plugin": "^8.50.0",
19
- "@typescript-eslint/parser": "^8.50.0",
20
- "@vitest/coverage-v8": "^4.0.16",
18
+ "@typescript-eslint/eslint-plugin": "^8.63.0",
19
+ "@typescript-eslint/parser": "^8.63.0",
20
+ "@vitest/coverage-v8": "^4.1.10",
21
21
  "cli-table3": "^0.6.5",
22
22
  "decircularize": "^1.0.0",
23
23
  "deep-eql": "^5.0.2",
24
24
  "deep-equal": "^2.2.3",
25
25
  "dequal": "^2.0.3",
26
- "eslint": "^9.39.2",
26
+ "es-toolkit": "^1.49.0",
27
+ "eslint": "^9.39.4",
27
28
  "eslint-friendly-formatter": "^4.0.1",
28
29
  "eslint-plugin-import": "^2.32.0",
29
30
  "fast-deep-equal": "^3.1.3",
30
31
  "fast-glob": "^3.3.3",
31
- "lodash": "^4.17.21",
32
+ "lodash": "^4.18.1",
32
33
  "nano-equal": "^2.0.2",
33
- "prettier": "^3.7.4",
34
- "react": "^19.2.3",
35
- "react-dom": "^19.2.3",
34
+ "prettier": "^3.9.4",
35
+ "react": "^19.2.7",
36
+ "react-dom": "^19.2.7",
36
37
  "react-fast-compare": "^3.2.2",
37
- "release-it": "^19.1.0",
38
- "rollup": "^4.53.5",
38
+ "release-it": "^20.2.1",
39
+ "rollup": "^4.62.2",
39
40
  "shallow-equal-fuzzy": "^0.0.2",
40
- "tinybench": "^6.0.0",
41
+ "tinybench": "^6.0.2",
41
42
  "typescript": "^5.9.3",
42
- "typescript-eslint": "^8.50.0",
43
- "underscore": "^1.13.7",
44
- "vite": "^7.3.0",
45
- "vitest": "^4.0.16"
43
+ "typescript-eslint": "^8.63.0",
44
+ "underscore": "^1.13.8",
45
+ "vite": "^8.1.3",
46
+ "vitest": "^4.1.10"
46
47
  },
47
48
  "engines": {
48
49
  "node": ">=6.0.0"
@@ -109,5 +110,5 @@
109
110
  "sideEffects": false,
110
111
  "type": "module",
111
112
  "types": "./index.d.ts",
112
- "version": "6.0.0"
113
+ "version": "6.0.2"
113
114
  }