@conform-to/yup
Advanced tools
Comparing version 1.0.0-pre.2 to 1.0.0-pre.3
import { type Constraint, type Intent, type Submission } from '@conform-to/dom'; | ||
import * as yup from 'yup'; | ||
export declare function getFieldsetConstraint<Source extends yup.AnyObjectSchema>(source: Source): Record<string, Constraint>; | ||
export declare function parse<Schema extends yup.AnyObjectSchema>(payload: FormData | URLSearchParams, config: { | ||
schema: Schema | ((intents: Array<Intent> | null) => Schema); | ||
export declare function parseWithYup<Schema extends yup.AnyObjectSchema>(payload: FormData | URLSearchParams, config: { | ||
schema: Schema | ((intent: Intent | null) => Schema); | ||
async?: false; | ||
}): Submission<yup.InferType<Schema>, string[]>; | ||
export declare function parse<Schema extends yup.AnyObjectSchema>(payload: FormData | URLSearchParams, config: { | ||
schema: Schema | ((intents: Array<Intent> | null) => Schema); | ||
export declare function parseWithYup<Schema extends yup.AnyObjectSchema>(payload: FormData | URLSearchParams, config: { | ||
schema: Schema | ((intent: Intent | null) => Schema); | ||
async: true; | ||
}): Promise<Submission<yup.InferType<Schema>, string[]>>; |
@@ -93,6 +93,6 @@ 'use strict'; | ||
} | ||
function parse(payload, config) { | ||
function parseWithYup(payload, config) { | ||
return dom.parse(payload, { | ||
resolve(payload, intents) { | ||
var schema = typeof config.schema === 'function' ? config.schema(intents) : config.schema; | ||
resolve(payload, intent) { | ||
var schema = typeof config.schema === 'function' ? config.schema(intent) : config.schema; | ||
var resolveData = value => ({ | ||
@@ -132,2 +132,2 @@ value | ||
exports.getFieldsetConstraint = getFieldsetConstraint; | ||
exports.parse = parse; | ||
exports.parseWithYup = parseWithYup; |
@@ -6,3 +6,3 @@ { | ||
"license": "MIT", | ||
"version": "1.0.0-pre.2", | ||
"version": "1.0.0-pre.3", | ||
"main": "index.js", | ||
@@ -29,3 +29,3 @@ "module": "index.mjs", | ||
"peerDependencies": { | ||
"@conform-to/dom": "1.0.0-pre.2", | ||
"@conform-to/dom": "1.0.0-pre.3", | ||
"yup": ">=0.32.0" | ||
@@ -32,0 +32,0 @@ }, |
Sorry, the diff of this file is not supported yet
AI-detected possible typosquat
Supply chain riskAI has identified this package as a potential typosquat of a more popular package. This suggests that the package may be intentionally mimicking another package's name, description, or other metadata.
Found 1 instance in 1 package
14118
1