type-fest 2.5.0 → 2.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "type-fest",
3
- "version": "2.5.0",
3
+ "version": "2.5.1",
4
4
  "description": "A collection of essential TypeScript types",
5
5
  "license": "(MIT OR CC0-1.0)",
6
6
  "repository": "sindresorhus/type-fest",
@@ -43,7 +43,11 @@ export type PartialDeep<T> = T extends Primitive
43
43
  : T extends ((...arguments: any[]) => unknown)
44
44
  ? T | undefined
45
45
  : T extends object
46
- ? PartialObjectDeep<T>
46
+ ? T extends Array<infer ItemType> // Test for arrays/tuples, per https://github.com/microsoft/TypeScript/issues/35156
47
+ ? ItemType[] extends T // Test for arrays (non-tuples) specifically
48
+ ? Array<PartialDeep<ItemType | undefined>> // Recreate relevant array type to prevent eager evaluation of circular reference
49
+ : PartialObjectDeep<T> // Tuples behave properly
50
+ : PartialObjectDeep<T>
47
51
  : unknown;
48
52
 
49
53
  /**