From fff861d26bb2afd70b7be29d952d5a90fc205017 Mon Sep 17 00:00:00 2001 From: dojyorin Date: Thu, 23 May 2024 19:18:09 +0900 Subject: [PATCH] remove type. --- src/pure/deflate.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/pure/deflate.ts b/src/pure/deflate.ts index a8a7175..8ed86c3 100644 --- a/src/pure/deflate.ts +++ b/src/pure/deflate.ts @@ -1,8 +1,6 @@ import {streamEncode, streamDecode} from "./stream.ts"; -type CompressCodec = "gzip" | "deflate" | "deflate-raw"; - -const COMPRESS_CODEC:CompressCodec = "deflate-raw"; +const COMPRESS_CODEC = "deflate-raw"; /** * Compress binary with DEFLATE format. @@ -14,7 +12,7 @@ const COMPRESS_CODEC:CompressCodec = "deflate-raw"; * const decode = await deflateDecode(encode); * ``` */ -export async function deflateEncode(data:Uint8Array, codec?:CompressCodec):Promise{ +export async function deflateEncode(data:Uint8Array, codec?:string):Promise{ return await streamDecode(streamEncode(data).pipeThrough(new CompressionStream(codec ?? COMPRESS_CODEC))); } @@ -28,6 +26,6 @@ export async function deflateEncode(data:Uint8Array, codec?:CompressCodec):Promi * const decode = await deflateDecode(encode); * ``` */ -export async function deflateDecode(data:Uint8Array, codec?:CompressCodec):Promise{ +export async function deflateDecode(data:Uint8Array, codec?:string):Promise{ return await streamDecode(streamEncode(data).pipeThrough(new DecompressionStream(codec ?? COMPRESS_CODEC))); } \ No newline at end of file