Skip to content
This repository was archived by the owner on Jun 15, 2022. It is now read-only.

Commit 5b36136

Browse files
committed
improve UnpackNestedValue type
1 parent a2eb93a commit 5b36136

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ export type NonUndefined<T> = T extends undefined ? never : T;
108108

109109
export type UnpackNestedValue<T> = NonUndefined<T> extends NestedValue<infer U>
110110
? U
111+
: NonUndefined<T> extends Date | FileList
112+
? T
111113
: NonUndefined<T> extends object
112114
? { [K in keyof T]: UnpackNestedValue<T[K]> }
113115
: T;

0 commit comments

Comments
 (0)