Socket
Book a DemoInstallSign in
Socket

array-filter-unique

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

array-filter-unique

JavaScript array.filter() compatible unique filter

latest
Source
npmnpm
Version
3.1.0
Version published
Maintainers
1
Created
Source

array-filter-unique

NPM Version node deno module

JavaScript array.filter() compatible unique filter

As all unique libraries are used as a function and not within the easily stackable and immutable arr.format() style I made my own.

Install

Node.js:

npm install array-filter-unique

Deno:

import {/* ... */} from "https://deno.land/x/array_filter_unique/mod.ts";

Usage

import { arrayFilterUnique } from "array-filter-unique";

['a', 'a', 'b', 'c']
  .filter(arrayFilterUnique());
//=> ['a', 'b', 'c']

[{name: 'Alice', …}, {name: 'Peter', …}, {name: 'Alice', …}}]
  .filter(arrayFilterUnique(o => o.name));
//=> [{name: 'Alice', …}, {name: 'Peter', …}]

Migrate from v2 to v3

-const arrayFilterUnique = require('array-filter-unique');
+import {arrayFilterUnique} from 'array-filter-unique';

 someArray.filter(arrayFilterUnique());

Keywords

array

FAQs

Package last updated on 29 Jan 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts