Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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

  • 3.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
56
increased by180%
Maintainers
1
Weekly downloads
 
Created
Source

array-filter-unique

NPM Version node

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

npm install array-filter-unique

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', …}]

API

arrayFilterUnique([selector])

selector

Type: item => string

Select what to check in the given item

Migrate from v2 to v3

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

 someArray.filter(arrayFilterUnique());

Keywords

FAQs

Package last updated on 02 Jun 2022

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc