0.0.4 • Published 4 years ago

map-x v0.0.4

Weekly downloads
1
License
GPL-3
Repository
github
Last release
4 years ago

Auto detecting, non-destructive map for Object and Array

  • Auto detects Object or Array and applies the appropriate operation
  • Switches to native map, if available, in case of Array
  • Checks for hasOwnProperty in case of Object
  • Won't crash on missing arguments
  • Returns original input on missing handler

--

Usage:

Install with npm: npm install --save map-x

import mapx from 'map-x';

const square= value => value * value;

const arr= mapx( [1, 2, 3], square );
console.log( arr );
// [ 1, 4, 9 ]

const obj= mapx( {a: 1, b: 2, c: 3}, square );
console.log( obj );
// { a: 1, b: 4, c: 9 }

###license

MIT

0.0.4

4 years ago

0.0.3

7 years ago

0.0.2

8 years ago

0.0.1

8 years ago