starry.uniq

4.0.0 • Public • Published

Member of the starry suite—modular functions for iterable objects.

npm node

Status

Applies to the whole suite.

Build Status Coverage Status

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>

Package Sidebar

Install

npm i starry.uniq

Weekly Downloads

2

Version

4.0.0

License

MIT

Unpacked Size

4.94 kB

Total Files

9

Last publish

Collaborators

  • seangenabe