@daiso-tech/core
Version:
The library offers flexible, framework-agnostic solutions for modern web applications, built on adaptable components that integrate seamlessly with popular frameworks like Next Js.
28 lines • 792 B
JavaScript
/**
* @module Collection
*/
import {} from "../../../../collection/contracts/_module-exports.js";
import { resolveInvokable } from "../../../../utilities/_module-exports.js";
/**
* @internal
*/
export class SkipUntilIterable {
collection;
predicateFn;
constructor(collection, predicateFn) {
this.collection = collection;
this.predicateFn = predicateFn;
}
*[Symbol.iterator]() {
let hasMatched = false;
for (const [index, item] of this.collection.entries()) {
if (!hasMatched) {
hasMatched = resolveInvokable(this.predicateFn)(item, index, this.collection);
}
if (hasMatched) {
yield item;
}
}
}
}
//# sourceMappingURL=skip-until-iterable.js.map