1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | class SliceIterator {
|
4 | |
5 |
|
6 |
|
7 |
|
8 |
|
9 | constructor(source, start, end = Infinity) {
|
10 | this.source = source;
|
11 | this.start = start;
|
12 | this.end = end;
|
13 | this.i = 0;
|
14 | }
|
15 | next() {
|
16 |
|
17 | while (this.i < this.start) {
|
18 | const result = this.source.next();
|
19 | if (result.done) {
|
20 | return result;
|
21 | }
|
22 | this.i++;
|
23 | }
|
24 |
|
25 | this.i++;
|
26 | if (this.i >= this.end) {
|
27 | return { done: true };
|
28 | }
|
29 | return this.source.next();
|
30 | }
|
31 | }
|
32 | exports.SliceIterator = SliceIterator;
|
33 |
|
\ | No newline at end of file |