map-x
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
; const square= value * value; const arr= ;console;// [ 1, 4, 9 ] const obj= ;console;// { a: 1, b: 4, c: 9 }
license
MIT