Skip to main content
Module

x/fae/mod.ts>whereAny

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

Takes a specs objects whose property is a predicate function Each predicate is applied to the value of the corresponding property of the test object. Returns true if any of the predicates is 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(0), y: equals(20)}
 Fae.whereAny(spec, {x: 0, y: 200}) // true
 Fae.whereAny(spec, {x: 0, y: 10}) // true
 Fae.whereAny(spec, {x: 1, y: 101}) // false
 Fae.whereAny(spec, {x: 1, y: 2}) // true

type

WhereAny