2.0.3 • Published 4 years ago

qm-dedupe v2.0.3

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

qm-dedupe

Utility to remove duplicates in array. Works also with array of objects.

:warning: Disclaimer:

This module is published in good faith and for learning purpose only. The code is not production-ready, so any usage of it is strictly at your own risk :see_no_evil:.

Installation

npm i -S qm-dedupe

Usage

const { dedupeInit } = require("qm-dedupe");

const hasher = JSON.stringify; // default value
const compareByProperty = item => item.name; // default fn: item => item;

const dedupe = dedupeInit({ hasher, compareByProperty });
dedupe(arrayOfObects)
// -> [[unique elements],[duplicate elements]]

Credits

Based on module seriousManual/dedupe:.

License

MIT © qaraluch

2.0.3

4 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.2.1

5 years ago

1.2.0

6 years ago

1.1.0

6 years ago