Initial commit
This commit is contained in:
commit
b3a51a4115
10336 changed files with 2381973 additions and 0 deletions
20
node_modules/fast-check/lib/esm/stream/LazyIterableIterator.js
generated
vendored
Normal file
20
node_modules/fast-check/lib/esm/stream/LazyIterableIterator.js
generated
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
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();
|
||||
}
|
||||
}
|
||||
export function makeLazy(producer) {
|
||||
return new LazyIterableIterator(producer);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue