UNPKG

487 BJavaScriptView Raw
1import { IterableX } from './iterablex';
2class RangeIterable extends IterableX {
3 constructor(start, count) {
4 super();
5 this._start = start;
6 this._count = count;
7 }
8 *[Symbol.iterator]() {
9 for (let current = this._start, end = this._start + this._count; current < end; current++) {
10 yield current;
11 }
12 }
13}
14export function range(start, count) {
15 return new RangeIterable(start, count);
16}
17
18//# sourceMappingURL=range.mjs.map