functional-map
v1.0.0
Published
Extend javascript's Map object with higher-order functions
Downloads
3
Readme
functional-map
Extend javascript's Map object with higher-order functions.
Includes .map
, .filter
(which return a new Map) and .reduce
methods.
import Map from 'functional-map'
const nmap = new Map([[1, 2], [2, 3], [3, 4]])
.filter((value, key) => key < 3)
.map(value => value.toString())
.reduce((acc, current, key) => ({ ...acc, [key]: current }), {})
Install
yarn add functional-map
or
npm i functional-map
Import
// es2015
import Map from 'functional-map'
// commonJS
const Map = require('functional-map').default