Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo-mod-jslibs-dist.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'popperjs/package/dist/esm/utils/uniqueBy.js')
-rw-r--r--popperjs/package/dist/esm/utils/uniqueBy.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/popperjs/package/dist/esm/utils/uniqueBy.js b/popperjs/package/dist/esm/utils/uniqueBy.js
new file mode 100644
index 0000000..5e083f3
--- /dev/null
+++ b/popperjs/package/dist/esm/utils/uniqueBy.js
@@ -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;
+ }
+ });
+} \ No newline at end of file