Skip to content

Commit

Permalink
🐞 fix react-hook-form#11374: Nested deep partial with unknown (react-…
Browse files Browse the repository at this point in the history
…hook-form#11373)

* fix: Nested deep partial with unknown

* reset editor files

* added api extractor
  • Loading branch information
jonahallibone authored and rafaelcalhau committed May 5, 2024
1 parent 4f1514b commit 51703c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion reports/api-extractor.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export type DeepMap<T, TValue> = IsAny<T> extends true ? any : T extends Browser

// @public (undocumented)
export type DeepPartial<T> = T extends BrowserNativeObject | NestedValue ? T : {
[K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K];
[K in keyof T]?: T[K] extends never ? T[K] : DeepPartial<T[K]>;
};

// @public (undocumented)
Expand Down
4 changes: 3 additions & 1 deletion src/types/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ export type LiteralUnion<T extends U, U extends Primitive> =

export type DeepPartial<T> = T extends BrowserNativeObject | NestedValue
? T
: { [K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K] };
: {
[K in keyof T]?: T[K] extends never ? T[K] : DeepPartial<T[K]>;
};

export type DeepPartialSkipArrayKey<T> = T extends
| BrowserNativeObject
Expand Down

0 comments on commit 51703c1

Please sign in to comment.