File tree 2 files changed +6
-2
lines changed
packages/next-safe-action/src
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,9 @@ export type ErrorList = { _errors?: string[] } & {};
18
18
19
19
// Creates nested schema validation errors type using recursion.
20
20
export type SchemaErrors < S > = {
21
- [ K in keyof S ] ?: S [ K ] extends object ? Extend < ErrorList & SchemaErrors < S [ K ] > > : ErrorList ;
21
+ [ K in keyof S ] ?: S [ K ] extends object | null | undefined
22
+ ? Extend < ErrorList & SchemaErrors < S [ K ] > >
23
+ : ErrorList ;
22
24
} & { } ;
23
25
24
26
// This function is used to build the validation errors object from a list of validation issues.
Original file line number Diff line number Diff line change @@ -127,7 +127,9 @@ Creates nested schema validation errors type using recursion. Used in [`Validati
127
127
128
128
``` typescript
129
129
export type SchemaErrors <S > = {
130
- [K in keyof S ]? : S [K ] extends object ? Extend <ErrorList & SchemaErrors <S [K ]>> : ErrorList ;
130
+ [K in keyof S ]? : S [K ] extends object | null | undefined
131
+ ? Extend <ErrorList & SchemaErrors <S [K ]>>
132
+ : ErrorList ;
131
133
} & {};
132
134
```
133
135
You can’t perform that action at this time.
0 commit comments