aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared
diff options
context:
space:
mode:
Diffstat (limited to 'shared')
-rw-r--r--shared/core-utils/common/array.ts10
1 files changed, 9 insertions, 1 deletions
diff --git a/shared/core-utils/common/array.ts b/shared/core-utils/common/array.ts
index 9e326a5aa..95393c731 100644
--- a/shared/core-utils/common/array.ts
+++ b/shared/core-utils/common/array.ts
@@ -8,6 +8,14 @@ function findCommonElement <T> (array1: T[], array2: T[]) {
8 return null 8 return null
9} 9}
10 10
11// Avoid conflict with other toArray() functions
12function arrayify <T> (element: T | T[]) {
13 if (Array.isArray(element)) return element
14
15 return [ element ]
16}
17
11export { 18export {
12 findCommonElement 19 findCommonElement,
20 arrayify
13} 21}