Skip to content

Commit

Permalink
馃悶 fix #11374: Nested deep partial with unknown (#11373)
Browse files Browse the repository at this point in the history
* fix: Nested deep partial with unknown

* reset editor files

* added api extractor
  • Loading branch information
jonahallibone committed Jan 9, 2024
1 parent e4c1fb1 commit 75cab7f
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 75cab7f

Please sign in to comment.