Files
Shifted/node_modules/fast-check/lib/stream/LazyIterableIterator.js
2026-02-10 01:14:19 +00:00

24 lines
562 B
JavaScript

"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);
}