0.1.13 • Published 6 years ago

iterable-slice v0.1.13

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

iterable-slice

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

Extract part of iterable to array, like Array.slice().

const slice = require('iterable-slice');
// slice(<iterable>, [begin=0], [end], [target=[]], [at])
// (positive indexes only for iterable)

slice(new Set(['a', 'b']));
// ['a', 'b']
slice(new Set(['a', 'b']), 1);
// ['b']
slice(new Map([['a', 1], ['b', 2]]), 0, 1);
// [['a', 1]]
slice(['a', 'b', 'c'], 1, Number.MAX_SAFE_INTEGER, ['z']);
// ['z', 'b', 'c']
slice('abc', 0, 2, ['z', 'y', 'x'], 2);
// ['z', 'y', 'a', 'b']
0.1.13

6 years ago

0.1.12

6 years ago

0.1.11

6 years ago

0.1.10

6 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

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.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