Package Exports
- @extra-iterable/map
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@extra-iterable/map) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Map values in iterable to new values, like Array.map().
const mapTo = require('@extra-iterable/map');
// mapTo(<iterable>, <map function>, [this], [begin=0], [end], [target=[]], [at])
// - <map function>(<value>, <index>, <iterable>)
mapTo(new Set(['teenage', 'mutant']), (v) => v.length);
// [7, 6]
mapTo([1, 2, 3, 4], (v, i, itr) => v*v, null, 1);
// [4, 9, 16]
mapTo([1, 2, 3, 4], (v, i, itr) => v*v, null, 1, 3);
// [4, 9]
mapTo([1, 2, 3, 4], (v, i, itr) => v*v, null, 1, 3, [10, 11]);
// [10, 11, 4, 9]
mapTo([1, 2, 3, 4], (v, i, itr) => v*v, null, 1, 3, [10, 11], 1);
// [10, 4, 9]