You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today I used patch-package to patch type-fest@3.5.5 for the project I'm working on.
I added an additional check to be able to match objects with Date typed values.
Here is the diff that solved my problem:
diff --git a/node_modules/type-fest/source/partial-deep.d.ts b/node_modules/type-fest/source/partial-deep.d.ts
index bbb3605..c2dbd41 100644
--- a/node_modules/type-fest/source/partial-deep.d.ts+++ b/node_modules/type-fest/source/partial-deep.d.ts@@ -71,17 +71,19 @@ export type PartialDeep<T, Options extends PartialDeepOptions = {}> = T extends
? PartialReadonlySetDeep<ItemType, Options>
: T extends ((...arguments: any[]) => unknown)
? T | undefined
- : T extends object- ? T extends ReadonlyArray<infer ItemType> // Test for arrays/tuples, per https://github.com/microsoft/TypeScript/issues/35156- ? Options['recurseIntoArrays'] extends true- ? ItemType[] extends T // Test for arrays (non-tuples) specifically- ? readonly ItemType[] extends T // Differentiate readonly and mutable arrays- ? ReadonlyArray<PartialDeep<ItemType | undefined, Options>>- : Array<PartialDeep<ItemType | undefined, Options>>- : PartialObjectDeep<T, Options> // Tuples behave properly- : T // If they don't opt into array testing, just use the original type- : PartialObjectDeep<T, Options>- : unknown;+ : T extends Date // checks for Date+ ? T | undefined+ : T extends object+ ? T extends ReadonlyArray<infer ItemType> // Test for arrays/tuples, per https://github.com/microsoft/TypeScript/issues/35156+ ? Options['recurseIntoArrays'] extends true+ ? ItemType[] extends T // Test for arrays (non-tuples) specifically+ ? readonly ItemType[] extends T // Differentiate readonly and mutable arrays+ ? ReadonlyArray<PartialDeep<ItemType | undefined, Options>>+ : Array<PartialDeep<ItemType | undefined, Options>>+ : PartialObjectDeep<T, Options> // Tuples behave properly+ : T // If they don't opt into array testing, just use the original type+ : PartialObjectDeep<T, Options>+ : unknown;
/**
Same as `PartialDeep`, but accepts only `Map`s and as inputs. Internal helper for `PartialDeep`.
Hi! 馃憢
Firstly, thanks for your work on this project! 馃檪
Today I used patch-package to patch
type-fest@3.5.5
for the project I'm working on.I added an additional check to be able to match objects with
Date
typed values.Here is the diff that solved my problem:
This issue body was partially generated by patch-package.
The text was updated successfully, but these errors were encountered: