Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "map"

Index

Type aliases

Functions

Type aliases

MapFn

MapFn: function

Type declaration

    • (input: T): K
    • Parameters

      • input: T

      Returns K

Functions

map

  • map<T, K>(fn: function): function
  • map<T, K>(fn: MapFn<T, K>, items: T[]): K[]
  • map<T, K>(items: T[], fn: MapFn<T, K> | keyof T): K[]
  • Takes a function and a functor, applies the function to each of the functor's values, and returns a functor of the same shape.

    example
     const isOdd = (n) => n % 2 === 1;
    
     R.reject(isOdd, [1, 2, 3, 4]); //=> [2, 4]
    
     R.reject(isOdd, {a: 1, b: 2, c: 3, d: 4}); //=> {b: 2, d: 4}
    

    Type parameters

    • T

    • K

    Parameters

    • fn: function

      the function mapper

        • (input: T): K
        • Parameters

          • input: T

          Returns K

    Returns function

      • (items: T[]): K[]
      • Parameters

        • items: T[]

        Returns K[]

  • Takes a function and a functor, applies the function to each of the functor's values, and returns a functor of the same shape.

    Type parameters

    • T

    • K

    Parameters

    • fn: MapFn<T, K>
    • items: T[]

    Returns K[]

  • Takes a function and a functor, applies the function to each of the functor's values, and returns a functor of the same shape.

    Type parameters

    • T

    • K

    Parameters

    • items: T[]
    • fn: MapFn<T, K> | keyof T

    Returns K[]

Generated using TypeDoc