Merge pull request #124 from devcat/zlib

improve perf of zlib inflating
This commit is contained in:
Skillz4Killz
2020-10-01 14:03:33 -04:00
committed by GitHub
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -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,
+3 -1
View File
@@ -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") {