Merge pull request #1026 from ochen1/patch-3
Add support for Discord's new endpoints to update roles
This commit is contained in:
@@ -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