• Combines Predicates with a logical AND.

    The combined Predicate returns true if all of the Predicates returns true.

    Example

    Combine two Predicates with a logical AND

    const predicate = and(numberIsPositive, numberIsEven);
    const result = p(2);
    console.log(result); // true

    Example

    Returns an alwaysTrue Predicate if no args provided

    const predicate = and();
    const result = p();
    console.log(result); // true

    Returns

    true if all Predicates return true, otherwise false

    Type Parameters

    • T extends unknown[]

      the type of the Predicates

    Parameters

    Returns Predicate<T>

Generated using TypeDoc