@fvilers/uniq-array
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

@fvilers/uniq-array

An helper function to filter an array for uniqueness based on a property or a predicate

Installation

npm install @fvilers/uniq-array

or

yarn add @fvilers/uniq-array

ECMAScript module

Starting with version 2.0.0, this library will be published as an ECMAScript module.

Usage

import uniqArray from "@fvilers/uniq-array";

const array = uniqArray(
  [
    { letter: "alpha" },
    { letter: "beta" },
    { letter: "gamma" },
    { letter: "beta" },
    { letter: "alpha" },
  ],
  "letter"
);
console.log(array);

Will produce a new array containing

[{ letter: "alpha" }, { letter: "beta" }, { letter: "gamma" }];

Package Sidebar

Install

npm i @fvilers/uniq-array

Weekly Downloads

2

Version

2.0.0

License

MIT

Unpacked Size

5.32 kB

Total Files

13

Last publish

Collaborators

  • fvilers