@shopify/react-form
Advanced tools
Comparing version 0.3.8 to 0.3.9
@@ -8,2 +8,12 @@ # Changelog | ||
## [0.3.9] | ||
### Added | ||
- new `positiveIntegerString` validator to validate fractionless numbers [#760](https://github.com/Shopify/quilt/pull/760) | ||
### Fixed | ||
- `notEmptyString` now rejects empty strings, similar to `notEmpty` [#759](https://github.com/Shopify/quilt/pull/759) | ||
## [0.3.4] | ||
@@ -10,0 +20,0 @@ |
@@ -10,3 +10,4 @@ import { ErrorContent } from './validator'; | ||
export declare function notEmptyString(error: ErrorContent<string>): (input: string) => string | undefined; | ||
export declare function positiveIntegerString(error: ErrorContent<string>): (input: string) => string | undefined; | ||
export declare function positiveNumericString(error: ErrorContent<string>): (input: string) => string | undefined; | ||
export declare function numericString(error: ErrorContent<string>): (input: string) => string | undefined; |
@@ -19,16 +19,16 @@ "use strict"; | ||
function notEmptyString(error) { | ||
return validator_1.validator(predicates.notEmptyString)(error); | ||
return validator_1.validator(predicates.notEmptyString, { skipOnEmpty: false })(error); | ||
} | ||
exports.notEmptyString = notEmptyString; | ||
function positiveIntegerString(error) { | ||
return validator_1.validator(predicates.isPositiveIntegerString)(error); | ||
} | ||
exports.positiveIntegerString = positiveIntegerString; | ||
function positiveNumericString(error) { | ||
return validator_1.validator(function (input) { | ||
return input !== '' && (input.match(/[^0-9.,]/g) || []).length === 0; | ||
})(error); | ||
return validator_1.validator(predicates.isPositiveNumericString)(error); | ||
} | ||
exports.positiveNumericString = positiveNumericString; | ||
function numericString(error) { | ||
return validator_1.validator(function (input) { | ||
return input !== '' && (input.match(/[^0-9.,-]/g) || []).length === 0; | ||
})(error); | ||
return validator_1.validator(predicates.isNumericString)(error); | ||
} | ||
exports.numericString = numericString; |
{ | ||
"name": "@shopify/react-form", | ||
"version": "0.3.8", | ||
"version": "0.3.9", | ||
"license": "MIT", | ||
@@ -30,3 +30,3 @@ "description": "Manage react forms tersely and safely-typed with no magic using React hooks.", | ||
"devDependencies": { | ||
"@shopify/react-testing": "^1.6.0", | ||
"@shopify/react-testing": "^1.6.1", | ||
"@types/faker": "^4.1.5", | ||
@@ -40,3 +40,3 @@ "faker": "^4.1.0", | ||
"dependencies": { | ||
"@shopify/predicates": "^1.1.0", | ||
"@shopify/predicates": "^1.2.0", | ||
"@shopify/react-hooks": "^1.2.1", | ||
@@ -43,0 +43,0 @@ "fast-deep-equal": "^2.0.1", |
89186
1512
Updated@shopify/predicates@^1.2.0