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 +1 -1
- package/source/partial-deep.d.ts +5 -1
package/package.json
CHANGED
package/source/partial-deep.d.ts
CHANGED
|
@@ -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
|
-
?
|
|
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
|
/**
|