@shopify/react-form-state
Advanced tools
Comparing version 0.10.6 to 0.10.7
@@ -10,3 +10,3 @@ interface Matcher<Input, Fields> { | ||
export declare function validateList<Input extends object, Fields>(validatorDictionary: any): (input: Input[], fields: Fields) => any[] | undefined; | ||
export declare function validate<Input>(matcher: Matcher<Input, any>, errorContent: ErrorContent): (input: Input) => ErrorContent | undefined | void; | ||
export declare function validate<Input, Fields>(matcher: Matcher<Input, Fields>, errorContent: ErrorContent): (input: Input, fields: Fields) => string | void | StringMapper | undefined; | ||
export declare function validateRequired<Input>(matcher: Matcher<Input, any>, errorContent: ErrorContent): (input: Input) => ErrorContent | undefined | void; | ||
@@ -16,9 +16,9 @@ declare const validators: { | ||
length: number; | ||
}) => string | void | StringMapper | undefined; | ||
}, fields: {}) => string | void | StringMapper | undefined; | ||
lengthLessThan(length: number, errorContent: ErrorContent): (input: { | ||
length: number; | ||
}) => string | void | StringMapper | undefined; | ||
numericString(errorContent: ErrorContent): (input: string) => string | void | StringMapper | undefined; | ||
positiveNumericString(errorContent: ErrorContent): (input: string) => string | void | StringMapper | undefined; | ||
nonNumericString(errorContent: ErrorContent): (input: string) => string | void | StringMapper | undefined; | ||
}, fields: {}) => string | void | StringMapper | undefined; | ||
numericString(errorContent: ErrorContent): (input: string, fields: {}) => string | void | StringMapper | undefined; | ||
positiveNumericString(errorContent: ErrorContent): (input: string, fields: {}) => string | void | StringMapper | undefined; | ||
nonNumericString(errorContent: ErrorContent): (input: string, fields: {}) => string | void | StringMapper | undefined; | ||
requiredString(errorContent: ErrorContent): (input: string) => string | void | StringMapper | undefined; | ||
@@ -25,0 +25,0 @@ required(errorContent: ErrorContent): (input: any) => string | void | StringMapper | undefined; |
@@ -39,3 +39,3 @@ # Validators | ||
validators={{ | ||
title: validators.lengthLessThan(10, 'That title is too long') | ||
title: validators.lengthLessThan(10, 'That title is too long'), | ||
@@ -55,3 +55,3 @@ quantity: [ | ||
<TextField label="Description" {...fields.description} /> | ||
<TextField label="Quantity" {...fields.description} /> | ||
<TextField label="Quantity" {...fields.quantity} /> | ||
</form> | ||
@@ -58,0 +58,0 @@ ); |
{ | ||
"name": "@shopify/react-form-state", | ||
"version": "0.10.6", | ||
"version": "0.10.7", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "Manage react forms tersely and type-safe with no magic.", |
@@ -76,7 +76,2 @@ import { | ||
export function validate<Input>( | ||
matcher: Matcher<Input, any>, | ||
errorContent: ErrorContent, | ||
): (input: Input) => ErrorContent | undefined | void; | ||
export function validate<Input, Fields>( | ||
@@ -86,3 +81,3 @@ matcher: Matcher<Input, Fields>, | ||
) { | ||
return (input: Input, fields: Fields) => { | ||
return (input: Input, fields: Fields): ErrorContent | undefined | void => { | ||
const matches = matcher(input, fields); | ||
@@ -89,0 +84,0 @@ |
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
189168
4140