source: node_modules/es-toolkit/dist/array/uniqWith.js

Last change on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 411 bytes
Line 
1'use strict';
2
3Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
5function uniqWith(arr, areItemsEqual) {
6 const result = [];
7 for (let i = 0; i < arr.length; i++) {
8 const item = arr[i];
9 const isUniq = result.every(v => !areItemsEqual(v, item));
10 if (isUniq) {
11 result.push(item);
12 }
13 }
14 return result;
15}
16
17exports.uniqWith = uniqWith;
Note: See TracBrowser for help on using the repository browser.