File size: 562 Bytes
96af7c9 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.makeLazy = makeLazy;
class LazyIterableIterator {
constructor(producer) {
this.producer = producer;
}
[Symbol.iterator]() {
if (this.it === undefined) {
this.it = this.producer();
}
return this.it;
}
next() {
if (this.it === undefined) {
this.it = this.producer();
}
return this.it.next();
}
}
function makeLazy(producer) {
return new LazyIterableIterator(producer);
}
|