diff options
author | Chocobozzz <me@florianbigard.com> | 2022-07-27 13:44:40 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-07-27 13:52:13 +0200 |
commit | e3d6c6434f570f77c0532f86c82f78bcafb399ec (patch) | |
tree | 65d525f42c8cf55aba871093b3dd65964f5cd967 /shared/core-utils/common | |
parent | 073deef8862f462de5f159a57877ef415ebe4c69 (diff) | |
download | PeerTube-e3d6c6434f570f77c0532f86c82f78bcafb399ec.tar.gz PeerTube-e3d6c6434f570f77c0532f86c82f78bcafb399ec.tar.zst PeerTube-e3d6c6434f570f77c0532f86c82f78bcafb399ec.zip |
Add bulk action on following/followers
Diffstat (limited to 'shared/core-utils/common')
-rw-r--r-- | shared/core-utils/common/array.ts | 10 |
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 | ||
12 | function arrayify <T> (element: T | T[]) { | ||
13 | if (Array.isArray(element)) return element | ||
14 | |||
15 | return [ element ] | ||
16 | } | ||
17 | |||
11 | export { | 18 | export { |
12 | findCommonElement | 19 | findCommonElement, |
20 | arrayify | ||
13 | } | 21 | } |