Merge pull request #131 from Skillz4Killz/wasm-zlib

Use wasm zlib decompression @devcat
This commit is contained in:
chroventer
2020-10-02 09:54:59 -07:00
committed by GitHub
2 changed files with 2 additions and 2 deletions

View File

@@ -7,4 +7,4 @@ export {
isWebSocketPongEvent,
} from "https://deno.land/std@0.67.0/ws/mod.ts";
export type { WebSocket } from "https://deno.land/std@0.67.0/ws/mod.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";

View File

@@ -109,7 +109,7 @@ export async function createBasicShard(
}
if (message instanceof Uint8Array) {
message = new TextDecoder().decode(inflate(message as Uint8Array));
message = new TextDecoder().decode(inflate(message, 9));
}
if (typeof message === "string") {