starry.uniq
v4.0.0
Published
Member of the starry suite—modular functions for iterable objects.
Maintainers
Readme
Member of the starry suite—modular functions for iterable objects.
Status
Applies to the whole suite.
Usage
function uniq<T = any, TKey = any>(
iterable: Iterable<T>,
keySelector: (item: T) => TKey = x => x as T & TKey
): Iterable<T>Returns distinct elements from an iterable.
Parameters:
- iterable -
Iterable<T> - keySelector -
(item: T) => TKey: An optional selector with which uniqueness is determined. Default:x => x.
Returns: Iterable<T>
