/** * @public */ export async function* take(it: AsyncIterableIterator, count: number) { let i = 0 for await (const chunk of it) { if (i++ >= count) return yield chunk } }