fast-equals 6.0.0 → 6.0.1

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.
@@ -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
@@ -10,39 +10,39 @@
10
10
  "description": "A blazing-fast equality comparison utility for a variety of use-cases",
11
11
  "devDependencies": {
12
12
  "@planttheidea/build-tools": "^2.0.0",
13
- "@types/lodash": "^4.17.21",
14
- "@types/node": "^24.10.4",
13
+ "@types/lodash": "^4.17.24",
14
+ "@types/node": "^24.13.2",
15
15
  "@types/ramda": "^0.31.1",
16
- "@types/react": "^19.2.7",
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
+ "eslint": "^9.39.4",
27
27
  "eslint-friendly-formatter": "^4.0.1",
28
28
  "eslint-plugin-import": "^2.32.0",
29
29
  "fast-deep-equal": "^3.1.3",
30
30
  "fast-glob": "^3.3.3",
31
- "lodash": "^4.17.21",
31
+ "lodash": "^4.18.1",
32
32
  "nano-equal": "^2.0.2",
33
- "prettier": "^3.7.4",
34
- "react": "^19.2.3",
35
- "react-dom": "^19.2.3",
33
+ "prettier": "^3.9.4",
34
+ "react": "^19.2.7",
35
+ "react-dom": "^19.2.7",
36
36
  "react-fast-compare": "^3.2.2",
37
- "release-it": "^19.1.0",
38
- "rollup": "^4.53.5",
37
+ "release-it": "^19.2.4",
38
+ "rollup": "^4.62.2",
39
39
  "shallow-equal-fuzzy": "^0.0.2",
40
- "tinybench": "^6.0.0",
40
+ "tinybench": "^6.0.2",
41
41
  "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"
42
+ "typescript-eslint": "^8.63.0",
43
+ "underscore": "^1.13.8",
44
+ "vite": "^7.3.6",
45
+ "vitest": "^4.1.10"
46
46
  },
47
47
  "engines": {
48
48
  "node": ">=6.0.0"
@@ -109,5 +109,5 @@
109
109
  "sideEffects": false,
110
110
  "type": "module",
111
111
  "types": "./index.d.ts",
112
- "version": "6.0.0"
112
+ "version": "6.0.1"
113
113
  }