From 690bb8f9f3413147a4f71d5ff0a3cd8170a94ce3 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 17 Aug 2022 15:36:03 +0200 Subject: Prefer using Object.values --- shared/core-utils/common/array.ts | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'shared') diff --git a/shared/core-utils/common/array.ts b/shared/core-utils/common/array.ts index 95393c731..e1b422165 100644 --- a/shared/core-utils/common/array.ts +++ b/shared/core-utils/common/array.ts @@ -15,7 +15,13 @@ function arrayify (element: T | T[]) { return [ element ] } +// Avoid conflict with other uniq() functions +function uniqify (elements: T[]) { + return Array.from(new Set(elements)) +} + export { + uniqify, findCommonElement, arrayify } -- cgit v1.2.3