You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

curried-map

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

curried-map

A curried way to map an array through a function

1.0.1
latest
Source
npmnpm
Version published
Weekly downloads
4
100%
Maintainers
1
Weekly downloads
 
Created
Source

curried-map

A curried way to map an array through a function.

import map from 'curried-map';

Promise.resolve([0,1,2])
	.then( map(a=>a*a) );

API

map(fn, items)

fn is any function compatible with [].map.

items is an array.

Returns a new array of mapped items.

map(fn)

fn is any function compatible with [].map.

Returns a new function expecting an array. When the returned function is executed, it produces the mapped array.

var squarer = map(n=>n*n);

squarer([2,3]); // [4, 9]
squarer([4,5]); // [16, 25]

Keywords

array

FAQs

Package last updated on 03 Nov 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts