npm.io
0.0.1 • Published 2 years ago

@g-lib/unique

Licence
MIT
Version
0.0.1
Deps
0
Size
16 kB
Vulns
0
Weekly
0

GitHub Release NPM License GitHub forks GitHub stars Codacy Badge NPM Downloads

GitHub commits since latest release GitHub contributors npm bundle size (scoped)

unique

Function that removes any duplicated elements in the array.

install

npm i @g-lib/unique
yarn add @g-lib/unique
pnpm add @g-lib/unique
Usage:
import unique from '@g-lib/unique';

// or

const unique = require('@g-lib/unique');

console.log(
  unique([
    { a: { key: 'a' }, b: 'b' },
    { a: { key: 'a' }, b: 'b' },
  ]),
); // [{a: {key: "a"}, b: "b"}]
console.log(
  unique([
    [1, 2, true, undefined],
    [1, 2, true, undefined],
  ]),
); // [[1,2,true, undefined ]]

// ...
Function can be used with array of multiple types
@see Tests
Contributing is always welcomed.
@License MIT

Keywords