Skip to content
/ unique Public

Function that removes any duplicated elements in the array.

License

Notifications You must be signed in to change notification settings

9a8ri3L/unique

Repository files navigation

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

GitHub commits since latest release GitHub contributors npm package minimized gzipped size

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

About

Function that removes any duplicated elements in the array.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks