Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@shopify/react-form-state

Package Overview
Dependencies
Maintainers
13
Versions
146
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shopify/react-form-state - npm Package Compare versions

Comparing version 0.10.6 to 0.10.7

12

dist/validators.d.ts

@@ -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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc