uniqs is a lightweight JavaScript utility designed to create unique lists and unions of multiple lists, defining uniqueness based on strict object equality. Currently at version 2.0.0, this package distinguishes itself by prioritizing simplicity and a minimal footprint over raw performance, making it a suitable alternative to more comprehensive libraries like Lodash or Underscore for basic deduplication tasks. Its primary purpose is to provide a straightforward function for de-duplicating items and combining arrays without complex features or external dependencies, making it ideal for scenarios where bundle size and directness are critical. Items are maintained in their first-appearance order, reflecting their initial encounter in the input lists.
npm install uniqsVerified import paths — ran on the pinned version, not inferred.
Demonstrates deduplication of a single list, union of multiple lists, and handling of mixed individual items and lists.
For performance-critical applications or very large datasets, consider alternatives like JavaScript's native `Set` or `Lodash.uniq` which offer better time complexity (O(n)).
To deduplicate objects based on deep equality, you must implement custom serialization (e.g., `JSON.stringify`) or a custom comparison logic before passing them to `uniqs`, or use a library that supports deep comparisons.
Review the package's changelog or release notes for version 2.0.0 to understand specific breaking changes and update your codebase accordingly.
If you need deep equality, serialize objects (e.g., `JSON.stringify`) or use a custom comparison function before passing them to `uniqs`, or switch to a library that supports deep equality.
For performance-critical applications with large datasets, use JavaScript's built-in `Set` for O(n) performance with primitive values, or a more optimized library function like Lodash's `uniq` for objects.
No dependency data recorded yet.