UNPKG

@lou.codes/iterables

Version:
15 lines (14 loc) 502 B
/** * Yields a tuple for each item in the iterable with the index of said item. * * @category Asynchronous Generators * @example * ```typescript * zipIndex(["foo", "bar"]); // [[0, "foo"], [1, "bar"]] * ``` * @param iterable Iterable to add indexes to. * @yields Tuples with the index of each item. */ export declare const zipIndex: <ItemSecond>( iterableSecond: import("@lou.codes/types").IsomorphicIterable<ItemSecond>, ) => Readonly<AsyncIterableIterator<readonly [number, ItemSecond]>>;