Merge branch 'master' into feat/refactorIdentify

This commit is contained in:
Madeline
2023-04-13 19:45:44 +10:00
76 changed files with 7640 additions and 319 deletions
+1 -8
View File
@@ -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];
}