@lou.codes/iterables
Version:
🔁 Iterable and AsyncIterable utils
20 lines (19 loc) • 557 B
TypeScript
import type { IsomorphicIterable, Numeric } from "@lou.codes/types";
/**
* Drop the specified amount of items from the given iterable or asynchronous
* iterable.
*
* @category Asynchronous Generators
* @example
* ```typescript
* const drop2 = drop(2);
* drop2([1, 2, 3, 4, 5]); // [3, 4, 5]
* ```
* @param amount Amount of items to drop.
* @returns Curried function with `amount` in context.
*/
export declare const drop: (
amount: Numeric,
) => <Item>(
iterable: IsomorphicIterable<Item>,
) => Readonly<AsyncIterableIterator<Awaited<Item>>>;