UNPKG

@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.

22 lines 543 B
/** * @module Collection */ import {} from "../../../../collection/contracts/_module-exports.js"; /** * @internal */ export class TakeIterable { collection; limit; constructor(collection, limit) { this.collection = collection; this.limit = limit; } *[Symbol.iterator]() { if (this.limit < 0) { this.limit = this.collection.size() + this.limit; } yield* this.collection.takeWhile((_item, index) => index < this.limit); } } //# sourceMappingURL=take-iterable.js.map