Initial commit
This commit is contained in:
11
wwwroot/lib/popper.js/esm/utils/uniqueBy.js
Normal file
11
wwwroot/lib/popper.js/esm/utils/uniqueBy.js
Normal file
@@ -0,0 +1,11 @@
|
||||
export default function uniqueBy(arr, fn) {
|
||||
var identifiers = new Set();
|
||||
return arr.filter(function (item) {
|
||||
var identifier = fn(item);
|
||||
|
||||
if (!identifiers.has(identifier)) {
|
||||
identifiers.add(identifier);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user