Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Usage

import * as fun from "https://raw.githubusercontent.com/baetheus/fun/main/predicate.ts";

The Predicate type represents unary functions that return boolean values. Typically, these functions indicate the existence of some quality for the values passed as inputs. Some simple examples of Predicates are postive for numbers, non-null values, etc.

§Functions

and

Creates the intersection of two predicates, returning true if both predicates return true.

getCombinableAll
getCombinableAny
getInitializableAll

Get a Initializable<Predicate> for any type A that combines using the Predicate and function.

getInitializableAny

Get a Initializable<Predicate> for any type A that combines using the Predicate or function.

not

Negates the result of an existing Predicate.

or

Creates the union of two predicates, returning true if either predicate returns true.

premap

Create a Predicate using a Predicate and a function that takes a type L and returns a type D. This maps over the input value of the predicate.

§Interfaces

KindPredicate

Specifies Predicate as a Higher Kinded Type, with contravariant parameter A corresponding to the 0th index of any Substitutions.

§Type Aliases

Predicate

The Predicate type is a function that takes some value of type A and returns boolean, indicating that a property is true or false for the value A.