@epistemology-factory/crocks-web
Advanced tools
Comparing version 0.3.4 to 0.3.5
{ | ||
"name": "@epistemology-factory/crocks-web", | ||
"version": "0.3.4", | ||
"version": "0.3.5", | ||
"description": "Functions to help write web applications with crocks", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -5,2 +5,3 @@ "use strict"; | ||
IS_DEFINED: "is-defined", | ||
IS_INT_STRING: "is-int-string", | ||
IS_ISO_DATE: "is-iso-date", | ||
@@ -14,2 +15,3 @@ IS_JSON: "is-json", | ||
[CONSTRAINTS.IS_DEFINED]: "should not be null or undefined", | ||
[CONSTRAINTS.IS_INT_STRING]: "should be an integer string", | ||
[CONSTRAINTS.IS_ISO_DATE]: "should be an ISO date", | ||
@@ -16,0 +18,0 @@ [CONSTRAINTS.IS_JSON]: "must be valid JSON", |
@@ -30,5 +30,15 @@ "use strict"; | ||
// isIntString :: [ String ] -> a -> Result ValidationFailure a | ||
const isIntString = makeValidator( | ||
matchesRegex(/^\d+$/), | ||
validationFailure( | ||
CONSTRAINTS.IS_INT_STRING, | ||
DEFAULT_MESSAGES[CONSTRAINTS.IS_INT_STRING] | ||
) | ||
) | ||
module.exports = { | ||
isIntString, | ||
isISODate, | ||
isString | ||
} |
@@ -38,3 +38,3 @@ "use strict"; | ||
// parseBody :: (a -> Result Object) -> Object -> Result Object | ||
// parseBody :: ([ String ] -> a -> Result Object) -> Object -> Result Object | ||
const parseBody = curry((parse) => | ||
@@ -41,0 +41,0 @@ pipeK( |
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
32971
926