Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
array-unique
Advanced tools
Package description
The array-unique npm package is a small utility that removes duplicate values from an array. It is useful when you need to ensure that an array contains only unique items without having to write custom deduplication logic.
Deduplicate an array
This feature allows you to remove duplicate values from an array, resulting in an array of only unique items. The `arrayUnique` function is used as a callback for the `filter` method.
[1, 2, 2, 3, 4, 4, 5, 5].filter(arrayUnique)
Lodash is a popular utility library that includes a `uniq` function. This function is similar to array-unique in that it removes duplicate values from an array. Lodash offers a wide range of additional utility functions, which makes it a more comprehensive solution than array-unique, but also larger in size.
Underscore.js is another utility library that provides a `uniq` function, similar to array-unique. It is comparable to Lodash in functionality and size, and it also offers a wide range of utility functions beyond array deduplication.
Ramda is a functional programming library that includes a `uniq` function. It is designed with a focus on functional programming patterns and immutability. Ramda's `uniq` function provides similar functionality to array-unique, but within the context of a larger functional programming toolkit.
Readme
Return an array free of duplicate values. Fastest ES5 implementation.
npm i array-unique --save
Install dev dependencies.
npm i -d && npm test
var unique = require('array-unique');
unique(['a', 'b', 'c', 'c']);
//=> ['a', 'b', 'c']
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Jon Schlinkert
Copyright (c) 2015 Jon Schlinkert
Released under the MIT license
This file was generated by verb-cli on March 11, 2015.
FAQs
Remove duplicate values from an array. Fastest ES5 implementation.
The npm package array-unique receives a total of 14,486,065 weekly downloads. As such, array-unique popularity was classified as popular.
We found that array-unique demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.