fast-equals 6.1.1 → 6.2.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/README.md CHANGED
@@ -235,6 +235,7 @@ Performs the same comparison as `deepEqual` but performs a strict comparison of
235
235
  - Checking full descriptor of properties on the object to match
236
236
  - Checking non-index properties on arrays
237
237
  - Checking non-key properties on `Map` / `Set` objects
238
+ - Checking own properties on `Date` objects
238
239
 
239
240
  ```ts
240
241
  const array = [{ foo: 'bar' }];
@@ -255,6 +256,7 @@ Performs the same comparison as `shallowEqual` but performs a strict comparison
255
256
  - Checking full descriptor of properties on the object to match
256
257
  - Checking non-index properties on arrays
257
258
  - Checking non-key properties on `Map` / `Set` objects
259
+ - Checking own properties on `Date` objects
258
260
 
259
261
  ```ts
260
262
  const array = ['foo'];
@@ -276,6 +278,7 @@ Performs the same comparison as `circularDeepEqual` but performs a strict compar
276
278
  - Checking full descriptor of properties on the object to match
277
279
  - Checking non-index properties on arrays
278
280
  - Checking non-key properties on `Map` / `Set` objects
281
+ - Checking own properties on `Date` objects
279
282
 
280
283
  ```ts
281
284
  function Circular(value) {
@@ -315,6 +318,7 @@ Performs the same comparison as `circularShallowEqual` but performs a strict com
315
318
  - Checking full descriptor of properties on the object to match
316
319
  - Checking non-index properties on arrays
317
320
  - Checking non-key properties on `Map` / `Set` objects
321
+ - Checking own properties on `Date` objects
318
322
 
319
323
  ```ts
320
324
  const array = ['foo'];
@@ -523,7 +523,9 @@ function createEqualityComparatorConfig({ circular, createCustomConfig, strict,
523
523
  areArrayBuffersEqual,
524
524
  areArraysEqual: strict ? areObjectsEqualStrict : areArraysEqual,
525
525
  areDataViewsEqual,
526
- areDatesEqual: areDatesEqual,
526
+ areDatesEqual: strict
527
+ ? combineComparators(areDatesEqual, areObjectsEqualStrict)
528
+ : areDatesEqual,
527
529
  // `Error` subclasses routinely carry their own enumerable properties (`status`, `code`, ...),
528
530
  // which the error comparator alone does not see, so it is composed with the object comparator.
529
531
  // `name` / `message` / `stack` are own but not enumerable, which is why errors need a
@@ -550,6 +552,7 @@ function createEqualityComparatorConfig({ circular, createCustomConfig, strict,
550
552
  }
551
553
  if (circular) {
552
554
  const areArraysEqual = createIsCircular(config.areArraysEqual);
555
+ const areDatesEqual = strict ? createIsCircular(config.areDatesEqual) : config.areDatesEqual;
553
556
  // Errors are included because comparing `cause` and own properties by value means an error
554
557
  // that references itself would otherwise recurse without bound.
555
558
  const areErrorsEqual = createIsCircular(config.areErrorsEqual);
@@ -558,6 +561,7 @@ function createEqualityComparatorConfig({ circular, createCustomConfig, strict,
558
561
  const areSetsEqual = createIsCircular(config.areSetsEqual);
559
562
  config = Object.assign({}, config, {
560
563
  areArraysEqual,
564
+ areDatesEqual,
561
565
  areErrorsEqual,
562
566
  areMapsEqual,
563
567
  areObjectsEqual,
@@ -43,7 +43,8 @@ interface ComparatorConfig<Meta> {
43
43
  */
44
44
  areDataViewsEqual: EqualityComparator<Meta>;
45
45
  /**
46
- * Whether the dates passed are equal in value.
46
+ * Whether the dates passed are equal in value. In strict mode, this includes
47
+ * additional properties added to the date.
47
48
  */
48
49
  areDatesEqual: EqualityComparator<Meta>;
49
50
  /**
@@ -43,7 +43,8 @@ interface ComparatorConfig<Meta> {
43
43
  */
44
44
  areDataViewsEqual: EqualityComparator<Meta>;
45
45
  /**
46
- * Whether the dates passed are equal in value.
46
+ * Whether the dates passed are equal in value. In strict mode, this includes
47
+ * additional properties added to the date.
47
48
  */
48
49
  areDatesEqual: EqualityComparator<Meta>;
49
50
  /**
package/dist/es/index.mjs CHANGED
@@ -521,7 +521,9 @@ function createEqualityComparatorConfig({ circular, createCustomConfig, strict,
521
521
  areArrayBuffersEqual,
522
522
  areArraysEqual: strict ? areObjectsEqualStrict : areArraysEqual,
523
523
  areDataViewsEqual,
524
- areDatesEqual: areDatesEqual,
524
+ areDatesEqual: strict
525
+ ? combineComparators(areDatesEqual, areObjectsEqualStrict)
526
+ : areDatesEqual,
525
527
  // `Error` subclasses routinely carry their own enumerable properties (`status`, `code`, ...),
526
528
  // which the error comparator alone does not see, so it is composed with the object comparator.
527
529
  // `name` / `message` / `stack` are own but not enumerable, which is why errors need a
@@ -548,6 +550,7 @@ function createEqualityComparatorConfig({ circular, createCustomConfig, strict,
548
550
  }
549
551
  if (circular) {
550
552
  const areArraysEqual = createIsCircular(config.areArraysEqual);
553
+ const areDatesEqual = strict ? createIsCircular(config.areDatesEqual) : config.areDatesEqual;
551
554
  // Errors are included because comparing `cause` and own properties by value means an error
552
555
  // that references itself would otherwise recurse without bound.
553
556
  const areErrorsEqual = createIsCircular(config.areErrorsEqual);
@@ -556,6 +559,7 @@ function createEqualityComparatorConfig({ circular, createCustomConfig, strict,
556
559
  const areSetsEqual = createIsCircular(config.areSetsEqual);
557
560
  config = Object.assign({}, config, {
558
561
  areArraysEqual,
562
+ areDatesEqual,
559
563
  areErrorsEqual,
560
564
  areMapsEqual,
561
565
  areObjectsEqual,
package/index.d.ts CHANGED
@@ -43,7 +43,8 @@ interface ComparatorConfig<Meta> {
43
43
  */
44
44
  areDataViewsEqual: EqualityComparator<Meta>;
45
45
  /**
46
- * Whether the dates passed are equal in value.
46
+ * Whether the dates passed are equal in value. In strict mode, this includes
47
+ * additional properties added to the date.
47
48
  */
48
49
  areDatesEqual: EqualityComparator<Meta>;
49
50
  /**
package/package.json CHANGED
@@ -11,12 +11,12 @@
11
11
  "devDependencies": {
12
12
  "@planttheidea/build-tools": "^2.0.8",
13
13
  "@types/lodash": "^4.17.25",
14
- "@types/node": "^24.13.3",
14
+ "@types/node": "^24.19.1",
15
15
  "@types/ramda": "^0.32.0",
16
- "@types/react": "^19.2.18",
17
- "@types/react-dom": "^19.2.5",
18
- "@typescript-eslint/eslint-plugin": "^8.69.0",
19
- "@typescript-eslint/parser": "^8.69.0",
16
+ "@types/react": "^19.3.0",
17
+ "@types/react-dom": "^19.3.0",
18
+ "@typescript-eslint/eslint-plugin": "^8.71.1",
19
+ "@typescript-eslint/parser": "^8.71.1",
20
20
  "@vitest/coverage-v8": "^4.1.11",
21
21
  "cli-table3": "^0.6.5",
22
22
  "decircularize": "^1.0.0",
@@ -31,18 +31,18 @@
31
31
  "fast-glob": "^3.3.3",
32
32
  "lodash": "^4.18.1",
33
33
  "nano-equal": "^2.0.2",
34
- "prettier": "^3.9.6",
35
- "react": "^19.2.8",
36
- "react-dom": "^19.2.8",
34
+ "prettier": "^3.9.9",
35
+ "react": "^19.3.0",
36
+ "react-dom": "^19.3.0",
37
37
  "react-fast-compare": "^3.2.2",
38
- "release-it": "^21.0.2",
39
- "rollup": "^4.63.1",
38
+ "release-it": "^21.1.1",
39
+ "rollup": "^4.64.3",
40
40
  "shallow-equal-fuzzy": "^0.0.2",
41
- "tinybench": "^6.1.4",
41
+ "tinybench": "^6.2.1",
42
42
  "typescript": "^6.0.3",
43
- "typescript-eslint": "^8.69.0",
43
+ "typescript-eslint": "^8.71.1",
44
44
  "underscore": "^1.13.8",
45
- "vite": "^8.2.2",
45
+ "vite": "^8.3.4",
46
46
  "vitest": "^4.1.11"
47
47
  },
48
48
  "engines": {
@@ -110,5 +110,5 @@
110
110
  "sideEffects": false,
111
111
  "type": "module",
112
112
  "types": "./index.d.ts",
113
- "version": "6.1.1"
113
+ "version": "6.2.0"
114
114
  }