server-act
Advanced tools
Comparing version 1.1.1 to 1.1.2
# server-act | ||
## 1.1.2 | ||
### Patch Changes | ||
- a832b11: Improve form errors type infer | ||
## 1.1.1 | ||
@@ -4,0 +10,0 @@ |
@@ -48,3 +48,3 @@ import { z } from 'zod'; | ||
input?: undefined; | ||
formErrors: z.ZodError<FormData extends InferParserType<TParams['_input'], 'in'> ? InferParserType<TParams['_input'], 'out'> : InferParserType<TParams['_input'], 'in'>>; | ||
formErrors: z.ZodError<TParams['_input'] extends z.ZodEffects<infer T, unknown, unknown> ? InferParserType<T, 'in'> : InferParserType<TParams['_input'], 'in'>>; | ||
})>) => Promise<TState>) => (prevState: TState, formData: FormData) => Promise<TState>; | ||
@@ -51,0 +51,0 @@ } |
{ | ||
"name": "server-act", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"homepage": "https://github.com/chungweileong94/server-act#readme", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -63,5 +63,4 @@ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ | ||
formErrors: z.ZodError< | ||
// Infer the input out-type if the in-type is formData, else the zod error type is incorrect | ||
FormData extends InferParserType<TParams['_input'], 'in'> | ||
? InferParserType<TParams['_input'], 'out'> | ||
TParams['_input'] extends z.ZodEffects<infer T, unknown, unknown> | ||
? InferParserType<T, 'in'> | ||
: InferParserType<TParams['_input'], 'in'> | ||
@@ -68,0 +67,0 @@ >; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
55829
626