find-array-duplicates
v1.0.6
Published
A simple array utility to find duplicates in your object array ๐
Downloads
10,465
Maintainers
Readme
find-array-duplicates
A utility function to find all duplicates within a provided object array
Information
Prerequisites
Node ^12.x nodejs.org
Install
or
Usage
duplicates
takes in 2 arguments arr
and property
. arr {Array}
should be an Array containing a list of objects of a similar structure.
property {String}
is the property within the object structure that you would like to check for duplicate values.
=> single()
Returns the first object of the filtered duplicates array
=> all()
Returns the entire list of duplicate objects on the property provided
=> modify(callback)
Allows you to modify the output of the final result, the call back function is provided with the entire list of duplicate objects
Returns any
entirely in your control.
=> find(callback)
Works exactly like Array.find
runs off the duplicate array
Returns an Object
based on the find
callback provided.
=> map(callback)
Works exactly like Array.map
runs off the duplicate array
Returns an Array
based on the map
callback provided.
=> filter(callback)
Works exactly like Array.filter
runs off the duplicate array.
Returns an Array
based on the filter
callback provided.
Please report issues on the github issue page. Hope you enjoy!