mirror of
https://github.com/spacebarchat/server.git
synced 2026-10-23 02:13:00 +00:00
Merge pull request #1026 from ochen1/patch-3
Add support for Discord's new endpoints to update roles
This commit is contained in:
5 files changed
+149
-8
No files matched your search
@@ -21,3 +21,11 @@
|
||||
export function containsAll(arr: unknown[], target: unknown[]) {
|
||||
return target.every((v) => arr.includes(v));
|
||||
}
|
||||
|
||||
/* https://stackoverflow.com/a/50636286 */
|
||||
export function partition<T>(array: T[], filter: (elem: T) => boolean) {
|
||||
const pass: T[] = [],
|
||||
fail: T[] = [];
|
||||
array.forEach((e) => (filter(e) ? pass : fail).push(e));
|
||||
return [pass, fail];
|
||||
}
|
||||
Reference in new issue
Block a user