0.1.3 • Published 6 years ago

iterable-mapto v0.1.3

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

iterable-mapto

NOTE: iterable-mapto was renamed to @extra-iterable/map. NPM

Map values in iterable to new values, like Array.map().

const mapTo = require('iterable-mapto');
// 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]
0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago