MCPcopy Create free account
hub / github.com/Effect-TS/effect / takeN

Method takeN

packages/effect/src/PubSub.ts:2788–2795  ·  view source on GitHub ↗
(n: number)

Source from the content-addressed store, hash-verified

2786 return value as A
2787 }
2788 takeN(n: number): Array<A> {
2789 const len = Math.min(n, this.remaining)
2790 const items = new Array(len)
2791 for (let i = 0; i < len; i++) {
2792 items[i] = this.take()!
2793 }
2794 return items
2795 }
2796 takeAll(): Array<A> {
2797 return this.takeN(this.remaining)
2798 }

Callers 1

takeAllMethod · 0.95

Calls 1

takeMethod · 0.95

Tested by

no test coverage detected