@conform-to/zod
Advanced tools
Comparing version 1.1.4 to 1.1.5
@@ -7,3 +7,6 @@ import { ZodEffects } from 'zod'; | ||
*/ | ||
export declare function coerceString(value: unknown, transform?: (text: string) => unknown): unknown; | ||
export declare function coerceString( | ||
value: unknown, | ||
transform?: (text: string) => unknown, | ||
): unknown; | ||
/** | ||
@@ -19,7 +22,11 @@ * Helpers for coercing file | ||
*/ | ||
export declare function isFileSchema(schema: ZodEffects<any, any, any>): boolean; | ||
export declare function isFileSchema( | ||
schema: ZodEffects<any, any, any>, | ||
): boolean; | ||
/** | ||
* @deprecated Conform coerce empty strings to undefined by default | ||
*/ | ||
export declare function ifNonEmptyString(fn: (text: string) => unknown): (value: unknown) => unknown; | ||
export declare function ifNonEmptyString( | ||
fn: (text: string) => unknown, | ||
): (value: unknown) => unknown; | ||
/** | ||
@@ -29,2 +36,5 @@ * Reconstruct the provided schema with additional preprocessing steps | ||
*/ | ||
export declare function enableTypeCoercion<Schema extends ZodTypeAny>(type: Schema, cache?: Map<ZodTypeAny, ZodTypeAny>): ZodType<output<Schema>>; | ||
export declare function enableTypeCoercion<Schema extends ZodTypeAny>( | ||
type: Schema, | ||
cache?: Map<ZodTypeAny, ZodTypeAny>, | ||
): ZodType<output<Schema>>; |
import type { Constraint } from '@conform-to/dom'; | ||
import type { ZodTypeAny } from 'zod'; | ||
export declare function getZodConstraint(schema: ZodTypeAny): Record<string, Constraint>; | ||
export declare function getZodConstraint( | ||
schema: ZodTypeAny, | ||
): Record<string, Constraint>; |
@@ -6,3 +6,3 @@ { | ||
"license": "MIT", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"main": "index.js", | ||
@@ -29,3 +29,3 @@ "module": "index.mjs", | ||
"dependencies": { | ||
"@conform-to/dom": "1.1.4" | ||
"@conform-to/dom": "1.1.5" | ||
}, | ||
@@ -32,0 +32,0 @@ "peerDependencies": { |
import { type Intent, type Submission } from '@conform-to/dom'; | ||
import { type ZodTypeAny, type ZodErrorMap, type input, type output, type ZodIssue } from 'zod'; | ||
export declare function parseWithZod<Schema extends ZodTypeAny>(payload: FormData | URLSearchParams, options: { | ||
schema: Schema | ((intent: Intent | null) => Schema); | ||
async?: false; | ||
errorMap?: ZodErrorMap; | ||
}): Submission<input<Schema>, string[], output<Schema>>; | ||
export declare function parseWithZod<Schema extends ZodTypeAny, FormError>(payload: FormData | URLSearchParams, options: { | ||
schema: Schema | ((intent: Intent | null) => Schema); | ||
async?: false; | ||
errorMap?: ZodErrorMap; | ||
formatError: (issues: Array<ZodIssue>) => FormError; | ||
}): Submission<input<Schema>, FormError, output<Schema>>; | ||
export declare function parseWithZod<Schema extends ZodTypeAny>(payload: FormData | URLSearchParams, options: { | ||
schema: Schema | ((intent: Intent | null) => Schema); | ||
async: true; | ||
errorMap?: ZodErrorMap; | ||
}): Promise<Submission<input<Schema>, string[], output<Schema>>>; | ||
export declare function parseWithZod<Schema extends ZodTypeAny, FormError>(payload: FormData | URLSearchParams, options: { | ||
schema: Schema | ((intent: Intent | null) => Schema); | ||
async: true; | ||
errorMap?: ZodErrorMap; | ||
formatError: (issues: Array<ZodIssue>) => FormError; | ||
}): Promise<Submission<input<Schema>, FormError, output<Schema>>>; | ||
import { | ||
type ZodTypeAny, | ||
type ZodErrorMap, | ||
type input, | ||
type output, | ||
type ZodIssue, | ||
} from 'zod'; | ||
export declare function parseWithZod<Schema extends ZodTypeAny>( | ||
payload: FormData | URLSearchParams, | ||
options: { | ||
schema: Schema | ((intent: Intent | null) => Schema); | ||
async?: false; | ||
errorMap?: ZodErrorMap; | ||
}, | ||
): Submission<input<Schema>, string[], output<Schema>>; | ||
export declare function parseWithZod<Schema extends ZodTypeAny, FormError>( | ||
payload: FormData | URLSearchParams, | ||
options: { | ||
schema: Schema | ((intent: Intent | null) => Schema); | ||
async?: false; | ||
errorMap?: ZodErrorMap; | ||
formatError: (issues: Array<ZodIssue>) => FormError; | ||
}, | ||
): Submission<input<Schema>, FormError, output<Schema>>; | ||
export declare function parseWithZod<Schema extends ZodTypeAny>( | ||
payload: FormData | URLSearchParams, | ||
options: { | ||
schema: Schema | ((intent: Intent | null) => Schema); | ||
async: true; | ||
errorMap?: ZodErrorMap; | ||
}, | ||
): Promise<Submission<input<Schema>, string[], output<Schema>>>; | ||
export declare function parseWithZod<Schema extends ZodTypeAny, FormError>( | ||
payload: FormData | URLSearchParams, | ||
options: { | ||
schema: Schema | ((intent: Intent | null) => Schema); | ||
async: true; | ||
errorMap?: ZodErrorMap; | ||
formatError: (issues: Array<ZodIssue>) => FormError; | ||
}, | ||
): Promise<Submission<input<Schema>, FormError, output<Schema>>>; | ||
export declare const conformZodMessage: { | ||
VALIDATION_SKIPPED: string; | ||
VALIDATION_UNDEFINED: string; | ||
VALIDATION_SKIPPED: string; | ||
VALIDATION_UNDEFINED: string; | ||
}; |
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
38249
17
834
+ Added@conform-to/dom@1.1.5(transitive)
- Removed@conform-to/dom@1.1.4(transitive)
Updated@conform-to/dom@1.1.5