@epistemology-factory/crocks-web
Advanced tools
Comparing version 0.2.5 to 0.2.6
{ | ||
"name": "@epistemology-factory/crocks-web", | ||
"version": "0.2.5", | ||
"version": "0.2.6", | ||
"description": "Functions to help write web applications with crocks", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -5,6 +5,13 @@ "use strict"; | ||
const chain = require("crocks/pointfree/chain"); | ||
const compose = require("crocks/helpers/compose"); | ||
const contramap = require("crocks/pointfree/contramap"); | ||
const curry = require("crocks/helpers/curry"); | ||
const ifElse = require("crocks/logic/ifElse"); | ||
const flip = require("crocks/combinators/flip"); | ||
const pipe = require("crocks/helpers/pipe"); | ||
const reduce = require("crocks/pointfree/reduce"); | ||
const { applyFunctor } = require("@epistemology-factory/crocks-ext/helpers"); | ||
// makeValidator :: (a -> Boolean) -> ([ String ] -> a -> ValidationFailure) -> [ String ] -> a -> Result ValidationFailure a | ||
@@ -19,4 +26,13 @@ const makeValidator = curry((pred, err) => (path) => | ||
// validators :: Foldable f => f -> [ String ] -> a -> Result ValidationFailure a | ||
const validators = (...validators) => | ||
pipe( | ||
applyFunctor(validators), | ||
flip(reduce(flip(chain))), | ||
contramap(Result.Ok) | ||
) | ||
module.exports = { | ||
makeValidator | ||
makeValidator, | ||
validators | ||
} |
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
26378
24
719