@lou.codes/iterables
Version:
🔁 Iterable and AsyncIterable utils
16 lines (15 loc) • 472 B
TypeScript
import type { ReadOnlyIterable } from "@lou.codes/types";
/**
* Returns a single instance of each item in the iterable.
*
* @category Generators
* @example
* ```typescript
* unique([1, 2, 3, 4, 1, 2, 3, 4]); // [1, 2, 3, 4]
* ```
* @param iterable Iterable to be filtered.
* @returns Generators with a single instance of each item of the iterable.
*/
export declare const unique: <Item>(
iterable: ReadOnlyIterable<Item>,
) => Readonly<IterableIterator<Item>>;