Socket
Socket
Sign inDemoInstall

@epistemology-factory/crocks-web

Package Overview
Dependencies
7
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.3.7 to 0.3.8

2

package.json
{
"name": "@epistemology-factory/crocks-web",
"version": "0.3.7",
"version": "0.3.8",
"description": "Functions to help write web applications with crocks",

@@ -5,0 +5,0 @@ "scripts": {

"use strict";
const Result = require("crocks/Result");
const curry = require("crocks/helpers/curry");
const map = require("crocks/pointfree/map");
const not = require("crocks/logic/not");
const option = require("crocks/pointfree/option");
const pipe = require("crocks/helpers/pipe");
const safe = require("crocks/Maybe/safe");

@@ -9,2 +16,11 @@ const { makeValidator } = require("./validator");

// ifPresent :: ([ String ] -> a -> Result ValidationFailure a) -> [ String ] -> a -> Result ValidationFailure a
const ifPresent = curry((validator, path) =>
pipe(
safe(require("crocks/predicates/isDefined")),
map(validator(path)),
option(Result.Ok(undefined))
)
)
// isDefinedFailure :: [String] -> a -> ValidationFailure

@@ -16,2 +32,3 @@ const isDefinedFailure = validationFailure(

// isDefined :: [ String ] -> a -> Result ValidationFailure a
const isDefined = makeValidator(

@@ -22,2 +39,3 @@ require("crocks/predicates/isDefined"),

// isNotEmpty :: [ String ] -> a -> Result ValidationFailure a
const isNotEmpty = makeValidator(

@@ -34,3 +52,4 @@ not(require("crocks/predicates/isEmpty")),

isDefinedFailure,
ifPresent: curry(ifPresent),
isNotEmpty
}

@@ -25,3 +25,3 @@ "use strict";

// validators :: Foldable f => f ([ String ] -> a -> Result ValidationFailure a)
// validators :: Foldable f => f ([ String ] -> a -> Result ValidationFailure a) -> [ String ] -> a -> Result ValidationFailure a
const validators = (...validators) =>

@@ -28,0 +28,0 @@ pipe(

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc