mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 16:57:22 +00:00
Merge pull request #124 from devcat/zlib
improve perf of zlib inflating
This commit is contained in:
@@ -2,7 +2,7 @@ export type { WebSocket } from "https://deno.land/std@0.67.0/ws/mod.ts";
|
||||
|
||||
export { encode } from "https://deno.land/std@0.67.0/encoding/base64.ts";
|
||||
export { delay } from "https://deno.land/std@0.67.0/async/delay.ts";
|
||||
export { inflate } from "https://deno.land/x/zlib.es@v1.0.0/mod.ts";
|
||||
export { decompress as inflate } from "https://unpkg.com/@evan/wasm@0.0.9/target/zlib/deno.js";
|
||||
export {
|
||||
connectWebSocket,
|
||||
isWebSocketCloseEvent,
|
||||
|
||||
@@ -107,7 +107,9 @@ export async function createBasicShard(
|
||||
}
|
||||
|
||||
if (message instanceof Uint8Array) {
|
||||
message = new TextDecoder().decode(inflate(message as Uint8Array));
|
||||
message = new TextDecoder().decode(
|
||||
inflate(message as Uint8Array) as Uint8Array,
|
||||
);
|
||||
}
|
||||
|
||||
if (typeof message === "string") {
|
||||
|
||||
Reference in New Issue
Block a user