Skip to content
/ mapify Public

Wrap around array map and turns any function into a mapping

Notifications You must be signed in to change notification settings

bredele/mapify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mapify

Turns any function into an array mapping

Installation

Install with component(1):

$ component install bredele/mapify

Usage

var mapify = require('mapify');
var square = mapify(function(n){return n * n;});

square([1,2,3]);
// [1,4,9]

Mapify get nicer when use with get.

var arr = [{
  name: 'olivier',
  age: '27'
},{
  name: 'amy'
  age: '26'
}];
mapify(get('name'))(arr);
// ['olivier', 'amy']

License

MIT

About

Wrap around array map and turns any function into a mapping

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published