server-act
Advanced tools
Comparing version 1.1.5 to 1.1.6
@@ -5,6 +5,7 @@ import { z } from 'zod'; | ||
type UnsetMarker = typeof unsetMarker; | ||
type Equals<X, Y> = (<T>() => T extends X ? 1 : 2) extends <T>() => T extends Y ? 1 : 2 ? true : false; | ||
type Prettify<T> = { | ||
[P in keyof T]: T[P]; | ||
} & {}; | ||
type OptionalizeUndefined<T> = undefined extends T ? [param?: T] : [param: T]; | ||
type SanitizeFunctionParam<T extends (param: any) => any> = T extends (param: infer P) => infer R ? Equals<P, undefined> extends true ? () => R : Equals<P, P | undefined> extends true ? (param?: P) => R : (param: P) => R : never; | ||
type InferParserType<T, TType extends 'in' | 'out'> = T extends z.ZodEffects<infer I, any, any> ? I[TType extends 'in' ? '_input' : '_output'] : T extends z.ZodType ? T[TType extends 'in' ? '_input' : '_output'] : never; | ||
@@ -38,3 +39,3 @@ type InferInputType<T, TType extends 'in' | 'out'> = T extends UnsetMarker ? undefined : InferParserType<T, TType>; | ||
input: InferInputType<TParams['_input'], 'out'>; | ||
}) => Promise<TOutput>) => (...[input]: OptionalizeUndefined<InferInputType<TParams['_input'], 'in'>>) => Promise<TOutput>; | ||
}) => Promise<TOutput>) => SanitizeFunctionParam<(input: InferInputType<TParams['_input'], 'in'>) => Promise<TOutput>>; | ||
/** | ||
@@ -41,0 +42,0 @@ * Create an action for React `useFormState` |
{ | ||
"name": "server-act", | ||
"version": "1.1.5", | ||
"version": "1.1.6", | ||
"homepage": "https://github.com/chungweileong94/server-act#readme", | ||
@@ -5,0 +5,0 @@ "author": "chungweileong94", |
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
17744
270