Skip to content

Commit

Permalink
remove type.
Browse files Browse the repository at this point in the history
  • Loading branch information
dojyorin committed May 23, 2024
1 parent c85193f commit fff861d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/pure/deflate.ts
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -14,7 +12,7 @@ const COMPRESS_CODEC:CompressCodec = "deflate-raw";
* const decode = await deflateDecode(encode);
* ```
*/
export async function deflateEncode(data:Uint8Array, codec?:CompressCodec):Promise<Uint8Array>{
export async function deflateEncode(data:Uint8Array, codec?:string):Promise<Uint8Array>{
return await streamDecode(streamEncode(data).pipeThrough(new CompressionStream(codec ?? COMPRESS_CODEC)));
}

Expand All @@ -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<Uint8Array>{
export async function deflateDecode(data:Uint8Array, codec?:string):Promise<Uint8Array>{
return await streamDecode(streamEncode(data).pipeThrough(new DecompressionStream(codec ?? COMPRESS_CODEC)));
}

0 comments on commit fff861d

Please sign in to comment.