fast-equals 5.3.2 → 5.3.3-beta.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.
- package/CHANGELOG.md +4 -0
- package/README.md +1 -1
- package/dist/cjs/index.cjs +9 -3
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/types/{comparator.d.ts → comparator.d.cts} +1 -1
- package/dist/{esm/types/equals.d.ts → cjs/types/equals.d.cts} +2 -2
- package/dist/cjs/types/{index.d.ts → index.d.cts} +3 -3
- package/dist/{esm/types/utils.d.ts → cjs/types/utils.d.cts} +1 -1
- package/dist/esm/index.mjs +9 -3
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/types/{comparator.d.ts → comparator.d.mts} +1 -1
- package/dist/{cjs/types/equals.d.ts → esm/types/equals.d.mts} +2 -2
- package/dist/esm/types/{index.d.ts → index.d.mts} +3 -3
- package/dist/{cjs/types/utils.d.ts → esm/types/utils.d.mts} +1 -1
- package/dist/min/index.js +1 -1
- package/dist/min/types/comparator.d.ts +1 -1
- package/dist/min/types/equals.d.ts +2 -2
- package/dist/min/types/index.d.ts +3 -3
- package/dist/min/types/utils.d.ts +1 -1
- package/dist/umd/index.js +9 -3
- package/dist/umd/index.js.map +1 -1
- package/dist/umd/types/comparator.d.ts +1 -1
- package/dist/umd/types/equals.d.ts +2 -2
- package/dist/umd/types/index.d.ts +3 -3
- package/dist/umd/types/utils.d.ts +1 -1
- package/index.d.ts +1 -1
- package/package.json +40 -42
- package/src/comparator.ts +7 -7
- package/src/equals.ts +8 -4
- package/src/index.ts +4 -4
- package/src/internalTypes.ts +1 -1
- package/src/utils.ts +2 -1
- /package/dist/cjs/types/{internalTypes.d.ts → internalTypes.d.cts} +0 -0
- /package/dist/esm/types/{internalTypes.d.ts → internalTypes.d.mts} +0 -0
package/src/equals.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { getStrictProperties, hasOwn, sameValueZeroEqual } from './utils';
|
|
1
|
+
import { getStrictProperties, hasOwn, sameValueZeroEqual } from './utils.js';
|
|
2
2
|
import type {
|
|
3
3
|
Dictionary,
|
|
4
4
|
PrimitiveWrapper,
|
|
5
5
|
State,
|
|
6
6
|
TypedArray,
|
|
7
|
-
} from './internalTypes';
|
|
7
|
+
} from './internalTypes.ts';
|
|
8
8
|
|
|
9
9
|
const PREACT_VNODE = '__v';
|
|
10
10
|
const PREACT_OWNER = '__o';
|
|
@@ -78,13 +78,14 @@ export function areMapsEqual(
|
|
|
78
78
|
return true;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
const matchedIndices
|
|
81
|
+
const matchedIndices = new Array<true | undefined>(size);
|
|
82
82
|
const aIterable = a.entries();
|
|
83
83
|
|
|
84
84
|
let aResult: IteratorResult<[any, any]>;
|
|
85
85
|
let bResult: IteratorResult<[any, any]>;
|
|
86
86
|
let index = 0;
|
|
87
87
|
|
|
88
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
88
89
|
while ((aResult = aIterable.next())) {
|
|
89
90
|
if (aResult.done) {
|
|
90
91
|
break;
|
|
@@ -95,6 +96,7 @@ export function areMapsEqual(
|
|
|
95
96
|
let hasMatch = false;
|
|
96
97
|
let matchIndex = 0;
|
|
97
98
|
|
|
99
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
98
100
|
while ((bResult = bIterable.next())) {
|
|
99
101
|
if (bResult.done) {
|
|
100
102
|
break;
|
|
@@ -247,12 +249,13 @@ export function areSetsEqual(
|
|
|
247
249
|
return true;
|
|
248
250
|
}
|
|
249
251
|
|
|
250
|
-
const matchedIndices
|
|
252
|
+
const matchedIndices = new Array<true | undefined>(size);
|
|
251
253
|
const aIterable = a.values();
|
|
252
254
|
|
|
253
255
|
let aResult: IteratorResult<any>;
|
|
254
256
|
let bResult: IteratorResult<any>;
|
|
255
257
|
|
|
258
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
256
259
|
while ((aResult = aIterable.next())) {
|
|
257
260
|
if (aResult.done) {
|
|
258
261
|
break;
|
|
@@ -263,6 +266,7 @@ export function areSetsEqual(
|
|
|
263
266
|
let hasMatch = false;
|
|
264
267
|
let matchIndex = 0;
|
|
265
268
|
|
|
269
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
266
270
|
while ((bResult = bIterable.next())) {
|
|
267
271
|
if (bResult.done) {
|
|
268
272
|
break;
|
package/src/index.ts
CHANGED
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
createEqualityComparator,
|
|
4
4
|
createInternalEqualityComparator,
|
|
5
5
|
createIsEqual,
|
|
6
|
-
} from './comparator';
|
|
7
|
-
import type { CustomEqualCreatorOptions } from './internalTypes';
|
|
8
|
-
import { sameValueZeroEqual } from './utils';
|
|
6
|
+
} from './comparator.js';
|
|
7
|
+
import type { CustomEqualCreatorOptions } from './internalTypes.ts';
|
|
8
|
+
import { sameValueZeroEqual } from './utils.js';
|
|
9
9
|
|
|
10
10
|
export { sameValueZeroEqual };
|
|
11
11
|
export type {
|
|
@@ -25,7 +25,7 @@ export type {
|
|
|
25
25
|
State,
|
|
26
26
|
TypeEqualityComparator,
|
|
27
27
|
TypedArray,
|
|
28
|
-
} from './internalTypes';
|
|
28
|
+
} from './internalTypes.ts';
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* Whether the items passed are deeply-equal in value.
|
package/src/internalTypes.ts
CHANGED
|
@@ -142,7 +142,7 @@ export type InternalEqualityComparator<Meta> = (
|
|
|
142
142
|
) => boolean;
|
|
143
143
|
|
|
144
144
|
// We explicitly check for primitive wrapper types
|
|
145
|
-
// eslint-disable-next-line @typescript-eslint/
|
|
145
|
+
// eslint-disable-next-line @typescript-eslint/no-wrapper-object-types
|
|
146
146
|
export type PrimitiveWrapper = Boolean | Number | String;
|
|
147
147
|
|
|
148
148
|
/**
|
package/src/utils.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type {
|
|
|
5
5
|
Dictionary,
|
|
6
6
|
State,
|
|
7
7
|
TypeEqualityComparator,
|
|
8
|
-
} from './internalTypes';
|
|
8
|
+
} from './internalTypes.ts';
|
|
9
9
|
|
|
10
10
|
const { getOwnPropertyNames, getOwnPropertySymbols } = Object;
|
|
11
11
|
const { hasOwnProperty } = Object.prototype;
|
|
@@ -83,6 +83,7 @@ export function getStrictProperties(
|
|
|
83
83
|
* Whether the object contains the property passed as an own property.
|
|
84
84
|
*/
|
|
85
85
|
export const hasOwn =
|
|
86
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
86
87
|
Object.hasOwn ||
|
|
87
88
|
((object: Dictionary, property: number | string | symbol) =>
|
|
88
89
|
hasOwnProperty.call(object, property));
|
|
File without changes
|
|
File without changes
|