Function negate

  • Takes a function and returns a copy with negated output.

    Example

    const isPositive = (value: number) => value >= 0;
    const isNegative = not(isPositive);

    isPositive(1); // true
    isNegative(1); // false

    Returns

    Source function with negated output.

    Type Parameters

    • Item

    • Predicated

    Parameters

    • predicate: Predicate<Item, Predicated>

      Function to be negated.

    Returns Single<Item> extends Single<Predicated> ? Unary<Item, boolean> : Predicate<Item, Exclude<Item, Predicated>>