map-tuple

1.0.0 • Public • Published

map-tuple

Map a list of n-tuples to a function with n separate arguments

Usage

var mapTuple = require('map-tuple');
 
var tuples = [
  [1],
  [2, 3],
  ['x', 'y', 'z'],
];
 
var result = mapTuple(tuples, function(a, b, c) {
  console.log(a, b, c);
  return a + (|| 0) + (|| 0);
});
//=> 1 undefined undefined 
//=> 2 3 undefined
//=> x y z 
 
console.log(result);
//=> [1, 5, "xyz"]

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    1

Package Sidebar

Install

npm i map-tuple

Weekly Downloads

1

Version

1.0.0

License

none

Last publish

Collaborators

  • zertosh