Function all

  • Example

    import * as A from "flurp/array";
    import * as N from "flurp/number";

    const allPositive = A.all(N.isPositive);
    allPositive([3, 5, 6])); // true
    allPositive([3, 5, -6])); // false
    allPositive([])); // true (since no failing elements)

    Type Parameters

    • T

    Parameters

    • condition: ((x: T) => boolean)
        • (x: T): boolean
        • Parameters

          • x: T

          Returns boolean

    Returns ((arr: readonly T[]) => boolean)

      • (arr: readonly T[]): boolean
      • Parameters

        • arr: readonly T[]

        Returns boolean