summary refs log tree commit diff
path: root/src/gateway
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2023-04-11 13:20:09 +1000
committerGitHub <noreply@github.com>2023-04-11 13:20:09 +1000
commitf040caa712567ddd01f55bb3a9227f7be350b726 (patch)
treef7575e45db55e0b799ca9bce9df3c05bdc75fdc9 /src/gateway
parentMerge pull request #1025 from ochen1/patch-2 (diff)
parentAdd erkins note (diff)
downloadserver-f040caa712567ddd01f55bb3a9227f7be350b726.tar.xz
Merge pull request #1026 from ochen1/patch-3
Add support for Discord's new endpoints to update roles
Diffstat (limited to 'src/gateway')
-rw-r--r--src/gateway/opcodes/LazyRequest.ts9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/gateway/opcodes/LazyRequest.ts b/src/gateway/opcodes/LazyRequest.ts

index 3cc2b655..64e50d92 100644 --- a/src/gateway/opcodes/LazyRequest.ts +++ b/src/gateway/opcodes/LazyRequest.ts
@@ -26,6 +26,7 @@ import { LazyRequestSchema, User, Presence, + partition, } from "@spacebar/util"; import { WebSocket, @@ -302,11 +303,3 @@ export async function onLazyRequest(this: WebSocket, { d }: Payload) { }, }); } - -/* https://stackoverflow.com/a/50636286 */ -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]; -}