unique-values
TypeScript icon, indicating that this package has built-in type declarations

4.0.0 • Public • Published

unique-values

Get the unique values from array, objects etc.

Changes

V4

  • sort removed from returned array. Sort yourself .sort((a, b) => a - b)

V3

  • Uses set instead of loop
  • returns only numbers
  • works on numbers

V2

  • typescript
  • dev dependencies

V1

  • still works.
  • no need to update your code base if you are using it.

Usage

    npm i unique-values
    const uniqueValues = require('unique-values')

    uniqueValues.getUniqueArrayValues([1, 2, 1, 2, 3, 4, 5, 10, 2, 3, 2, 3, 23, 2])
    // returns
    // [1, 2, 3, 4, 5, 10, 23]

    uniqueValues.getUniqueObjectValues({'a': 12, 'b': 14, 'c': 14, 'd': 12})
    // returns
    // [12, 14]

License

MIT © Git Faf 2017

Package Sidebar

Install

npm i unique-values

Weekly Downloads

2

Version

4.0.0

License

MIT

Unpacked Size

24.5 kB

Total Files

30

Last publish

Collaborators

  • iamanubhavsaini
  • git.faf