Skip to main content
Module

x/fae/whereAll.ts>whereAll

A functional module for Deno inspired from Ramda.
Latest
variable whereAll
import { whereAll } from "https://deno.land/x/fae@v1.1.1/whereAll.ts";

Takes a specs objects whose properties are predicate functions Each predicate is applied to the value of the corresponding property of the test object. Returns true if all the predicates are satisfied, false otherwise. NOTE returns false if there is no predicated functions

 const equals = curry(2, (x: number, y: number) => x === y)
 const spec = {x: equals(100), y: equals(20)}
 Fae.whereAll(spec, {x: 0, y: 200}) // false
 Fae.whereAll(spec, {x: 0, y: 10}) // false
 Fae.whereAll(spec, {x: 0, y: 2}) // true
 Fae.whereAll(spec, {x: 1, y: 2}) // false

type

WhereAll