4.0.0 • Published 7 years ago

starry.uniq v4.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

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>