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