• Returns x when the predicate is true, or the result of fn(x) when the predicate is false.

    Type Parameters

    • T

    Parameters

    Returns (<R>(fn) => ((x) => T | R))

      • <R>(fn): ((x) => T | R)
      • Type Parameters

        • R

        Parameters

        Returns ((x) => T | R)

          • (x): T | R
          • Parameters

            • x: T

            Returns T | R

    Example

    unless(isOdd)(add(2))(3)
    // => 3

    unless(isOdd)(add(2))(4)
    // => 6

Generated using TypeDoc