Options
All
  • Public
  • Public/Protected
  • All
Menu

Module function/curryN

Index

References

Functions

References

Renames and re-exports curryN

Functions

  • curryN<T1, TResult>(n: 1, fn: (a: T1) => a is TResult): (a: T1) => a is T1
  • curryN<T1, T2, TResult>(n: 2, fn: (a: T1, b: T2) => b is TResult): CurriedTypeGuard2<T1, T2, TResult>
  • curryN<T1, T2, T3, TResult>(n: 3, fn: (a: T1, b: T2, c: T3) => c is TResult): CurriedTypeGuard3<T1, T2, T3, TResult>
  • curryN<T1, T2, T3, T4, TResult>(n: 4, fn: (a: T1, b: T2, c: T3, d: T4) => d is TResult): CurriedTypeGuard4<T1, T2, T3, T4, TResult>
  • curryN<T1, T2, T3, T4, T5, TResult>(n: 5, fn: (a: T1, b: T2, c: T3, d: T4, e: T5) => e is TResult): CurriedTypeGuard5<T1, T2, T3, T4, T5, TResult>
  • curryN<T1, T2, T3, T4, T5, T6, TResult>(n: 6, fn: (a: T1, b: T2, c: T3, d: T4, e: T5, f: T6) => f is TResult): CurriedTypeGuard6<T1, T2, T3, T4, T5, T6, TResult>
  • curryN<T1, TResult>(n: 1, fn: (a: T1) => TResult): (a: T1) => TResult
  • curryN<T1, T2, TResult>(n: 2, fn: (a: T1, b: T2) => TResult): CurriedFunction2<T1, T2, TResult>
  • curryN<T1, T2, T3, TResult>(n: 3, fn: (a: T1, b: T2, c: T3) => TResult): CurriedFunction3<T1, T2, T3, TResult>
  • curryN<T1, T2, T3, T4, TResult>(n: 4, fn: (a: T1, b: T2, c: T3, d: T4) => TResult): CurriedFunction4<T1, T2, T3, T4, TResult>
  • curryN<T1, T2, T3, T4, T5, TResult>(n: 5, fn: (a: T1, b: T2, c: T3, d: T4, e: T5) => TResult): CurriedFunction5<T1, T2, T3, T4, T5, TResult>
  • curryN<T1, T2, T3, T4, T5, T6, TResult>(n: 6, fn: (a: T1, b: T2, c: T3, d: T4, e: T5, f: T6) => TResult): CurriedFunction6<T1, T2, T3, T4, T5, T6, TResult>
  • curryN(n: number, fn: (...a: any[]) => any): (...a: any[]) => any
  • Returns a curried equivalent of the provided function, with the specified arity. If g is curryN(3, f), the following are equivalent:

    • g(1)(2)(3)
    • g(1)(2, 3)
    • g(1, 2)(3)
    • g(1, 2, 3)
    example
     var sumArgs = (...args) => sum(args);

    var curriedAddFourNumbers = curryN(4, sumArgs);
    var f = curriedAddFourNumbers(1, 2);
    var g = f(3);
    g(4); //=> 10

    Type parameters

    • T1

    • TResult

    Parameters

    • n: 1
    • fn: (a: T1) => a is TResult

      The function to curry.

        • (a: T1): a is TResult
        • Parameters

          • a: T1

          Returns a is TResult

    Returns (a: T1) => a is T1

    A new, curried function.

      • (a: T1): a is T1
      • Parameters

        • a: T1

        Returns a is T1

  • Returns a curried equivalent of the provided function, with the specified arity. If g is curryN(3, f), the following are equivalent:

    • g(1)(2)(3)
    • g(1)(2, 3)
    • g(1, 2)(3)
    • g(1, 2, 3)
    example
     var sumArgs = (...args) => sum(args);

    var curriedAddFourNumbers = curryN(4, sumArgs);
    var f = curriedAddFourNumbers(1, 2);
    var g = f(3);
    g(4); //=> 10

    Type parameters

    • T1

    • T2

    • TResult

    Parameters

    • n: 2
    • fn: (a: T1, b: T2) => b is TResult

      The function to curry.

        • (a: T1, b: T2): b is TResult
        • Parameters

          • a: T1
          • b: T2

          Returns b is TResult

    Returns CurriedTypeGuard2<T1, T2, TResult>

    A new, curried function.

  • Returns a curried equivalent of the provided function, with the specified arity. If g is curryN(3, f), the following are equivalent:

    • g(1)(2)(3)
    • g(1)(2, 3)
    • g(1, 2)(3)
    • g(1, 2, 3)
    example
     var sumArgs = (...args) => sum(args);

    var curriedAddFourNumbers = curryN(4, sumArgs);
    var f = curriedAddFourNumbers(1, 2);
    var g = f(3);
    g(4); //=> 10

    Type parameters

    • T1

    • T2

    • T3

    • TResult

    Parameters

    • n: 3
    • fn: (a: T1, b: T2, c: T3) => c is TResult

      The function to curry.

        • (a: T1, b: T2, c: T3): c is TResult
        • Parameters

          • a: T1
          • b: T2
          • c: T3

          Returns c is TResult

    Returns CurriedTypeGuard3<T1, T2, T3, TResult>

    A new, curried function.

  • Returns a curried equivalent of the provided function, with the specified arity. If g is curryN(3, f), the following are equivalent:

    • g(1)(2)(3)
    • g(1)(2, 3)
    • g(1, 2)(3)
    • g(1, 2, 3)
    example
     var sumArgs = (...args) => sum(args);

    var curriedAddFourNumbers = curryN(4, sumArgs);
    var f = curriedAddFourNumbers(1, 2);
    var g = f(3);
    g(4); //=> 10

    Type parameters

    • T1

    • T2

    • T3

    • T4

    • TResult

    Parameters

    • n: 4
    • fn: (a: T1, b: T2, c: T3, d: T4) => d is TResult

      The function to curry.

        • (a: T1, b: T2, c: T3, d: T4): d is TResult
        • Parameters

          • a: T1
          • b: T2
          • c: T3
          • d: T4

          Returns d is TResult

    Returns CurriedTypeGuard4<T1, T2, T3, T4, TResult>

    A new, curried function.

  • Returns a curried equivalent of the provided function, with the specified arity. If g is curryN(3, f), the following are equivalent:

    • g(1)(2)(3)
    • g(1)(2, 3)
    • g(1, 2)(3)
    • g(1, 2, 3)
    example
     var sumArgs = (...args) => sum(args);

    var curriedAddFourNumbers = curryN(4, sumArgs);
    var f = curriedAddFourNumbers(1, 2);
    var g = f(3);
    g(4); //=> 10

    Type parameters

    • T1

    • T2

    • T3

    • T4

    • T5

    • TResult

    Parameters

    • n: 5
    • fn: (a: T1, b: T2, c: T3, d: T4, e: T5) => e is TResult

      The function to curry.

        • (a: T1, b: T2, c: T3, d: T4, e: T5): e is TResult
        • Parameters

          • a: T1
          • b: T2
          • c: T3
          • d: T4
          • e: T5

          Returns e is TResult

    Returns CurriedTypeGuard5<T1, T2, T3, T4, T5, TResult>

    A new, curried function.

  • Returns a curried equivalent of the provided function, with the specified arity. If g is curryN(3, f), the following are equivalent:

    • g(1)(2)(3)
    • g(1)(2, 3)
    • g(1, 2)(3)
    • g(1, 2, 3)
    example
     var sumArgs = (...args) => sum(args);

    var curriedAddFourNumbers = curryN(4, sumArgs);
    var f = curriedAddFourNumbers(1, 2);
    var g = f(3);
    g(4); //=> 10

    Type parameters

    • T1

    • T2

    • T3

    • T4

    • T5

    • T6

    • TResult

    Parameters

    • n: 6
    • fn: (a: T1, b: T2, c: T3, d: T4, e: T5, f: T6) => f is TResult

      The function to curry.

        • (a: T1, b: T2, c: T3, d: T4, e: T5, f: T6): f is TResult
        • Parameters

          • a: T1
          • b: T2
          • c: T3
          • d: T4
          • e: T5
          • f: T6

          Returns f is TResult

    Returns CurriedTypeGuard6<T1, T2, T3, T4, T5, T6, TResult>

    A new, curried function.

  • Returns a curried equivalent of the provided function, with the specified arity. If g is curryN(3, f), the following are equivalent:

    • g(1)(2)(3)
    • g(1)(2, 3)
    • g(1, 2)(3)
    • g(1, 2, 3)
    example
     var sumArgs = (...args) => sum(args);

    var curriedAddFourNumbers = curryN(4, sumArgs);
    var f = curriedAddFourNumbers(1, 2);
    var g = f(3);
    g(4); //=> 10

    Type parameters

    • T1

    • TResult

    Parameters

    • n: 1
    • fn: (a: T1) => TResult

      The function to curry.

        • (a: T1): TResult
        • Parameters

          • a: T1

          Returns TResult

    Returns (a: T1) => TResult

    A new, curried function.

      • (a: T1): TResult
      • Parameters

        • a: T1

        Returns TResult

  • Returns a curried equivalent of the provided function, with the specified arity. If g is curryN(3, f), the following are equivalent:

    • g(1)(2)(3)
    • g(1)(2, 3)
    • g(1, 2)(3)
    • g(1, 2, 3)
    example
     var sumArgs = (...args) => sum(args);

    var curriedAddFourNumbers = curryN(4, sumArgs);
    var f = curriedAddFourNumbers(1, 2);
    var g = f(3);
    g(4); //=> 10

    Type parameters

    • T1

    • T2

    • TResult

    Parameters

    • n: 2
    • fn: (a: T1, b: T2) => TResult

      The function to curry.

        • (a: T1, b: T2): TResult
        • Parameters

          • a: T1
          • b: T2

          Returns TResult

    Returns CurriedFunction2<T1, T2, TResult>

    A new, curried function.

  • Returns a curried equivalent of the provided function, with the specified arity. If g is curryN(3, f), the following are equivalent:

    • g(1)(2)(3)
    • g(1)(2, 3)
    • g(1, 2)(3)
    • g(1, 2, 3)
    example
     var sumArgs = (...args) => sum(args);

    var curriedAddFourNumbers = curryN(4, sumArgs);
    var f = curriedAddFourNumbers(1, 2);
    var g = f(3);
    g(4); //=> 10

    Type parameters

    • T1

    • T2

    • T3

    • TResult

    Parameters

    • n: 3
    • fn: (a: T1, b: T2, c: T3) => TResult

      The function to curry.

        • (a: T1, b: T2, c: T3): TResult
        • Parameters

          • a: T1
          • b: T2
          • c: T3

          Returns TResult

    Returns CurriedFunction3<T1, T2, T3, TResult>

    A new, curried function.

  • Returns a curried equivalent of the provided function, with the specified arity. If g is curryN(3, f), the following are equivalent:

    • g(1)(2)(3)
    • g(1)(2, 3)
    • g(1, 2)(3)
    • g(1, 2, 3)
    example
     var sumArgs = (...args) => sum(args);

    var curriedAddFourNumbers = curryN(4, sumArgs);
    var f = curriedAddFourNumbers(1, 2);
    var g = f(3);
    g(4); //=> 10

    Type parameters

    • T1

    • T2

    • T3

    • T4

    • TResult

    Parameters

    • n: 4
    • fn: (a: T1, b: T2, c: T3, d: T4) => TResult

      The function to curry.

        • (a: T1, b: T2, c: T3, d: T4): TResult
        • Parameters

          • a: T1
          • b: T2
          • c: T3
          • d: T4

          Returns TResult

    Returns CurriedFunction4<T1, T2, T3, T4, TResult>

    A new, curried function.

  • Returns a curried equivalent of the provided function, with the specified arity. If g is curryN(3, f), the following are equivalent:

    • g(1)(2)(3)
    • g(1)(2, 3)
    • g(1, 2)(3)
    • g(1, 2, 3)
    example
     var sumArgs = (...args) => sum(args);

    var curriedAddFourNumbers = curryN(4, sumArgs);
    var f = curriedAddFourNumbers(1, 2);
    var g = f(3);
    g(4); //=> 10

    Type parameters

    • T1

    • T2

    • T3

    • T4

    • T5

    • TResult

    Parameters

    • n: 5
    • fn: (a: T1, b: T2, c: T3, d: T4, e: T5) => TResult

      The function to curry.

        • (a: T1, b: T2, c: T3, d: T4, e: T5): TResult
        • Parameters

          • a: T1
          • b: T2
          • c: T3
          • d: T4
          • e: T5

          Returns TResult

    Returns CurriedFunction5<T1, T2, T3, T4, T5, TResult>

    A new, curried function.

  • Returns a curried equivalent of the provided function, with the specified arity. If g is curryN(3, f), the following are equivalent:

    • g(1)(2)(3)
    • g(1)(2, 3)
    • g(1, 2)(3)
    • g(1, 2, 3)
    example
     var sumArgs = (...args) => sum(args);

    var curriedAddFourNumbers = curryN(4, sumArgs);
    var f = curriedAddFourNumbers(1, 2);
    var g = f(3);
    g(4); //=> 10

    Type parameters

    • T1

    • T2

    • T3

    • T4

    • T5

    • T6

    • TResult

    Parameters

    • n: 6
    • fn: (a: T1, b: T2, c: T3, d: T4, e: T5, f: T6) => TResult

      The function to curry.

        • (a: T1, b: T2, c: T3, d: T4, e: T5, f: T6): TResult
        • Parameters

          • a: T1
          • b: T2
          • c: T3
          • d: T4
          • e: T5
          • f: T6

          Returns TResult

    Returns CurriedFunction6<T1, T2, T3, T4, T5, T6, TResult>

    A new, curried function.

  • Returns a curried equivalent of the provided function, with the specified arity. If g is curryN(3, f), the following are equivalent:

    • g(1)(2)(3)
    • g(1)(2, 3)
    • g(1, 2)(3)
    • g(1, 2, 3)
    example
     var sumArgs = (...args) => sum(args);

    var curriedAddFourNumbers = curryN(4, sumArgs);
    var f = curriedAddFourNumbers(1, 2);
    var g = f(3);
    g(4); //=> 10

    Parameters

    • n: number
    • fn: (...a: any[]) => any

      The function to curry.

        • (...a: any[]): any
        • Parameters

          • Rest ...a: any[]

          Returns any

    Returns (...a: any[]) => any

    A new, curried function.

      • (...a: any[]): any
      • Parameters

        • Rest ...a: any[]

        Returns any

Generated using TypeDoc