mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-24 16:02:55 +08:00
fix(cli): type zstd worker helpers
This commit is contained in:
@@ -1,8 +1,15 @@
|
||||
import { zstdCompress, zstdDecompress } from "node:zlib"
|
||||
import { promisify } from "node:util"
|
||||
import * as zlib from "node:zlib"
|
||||
|
||||
const compress = promisify(zstdCompress)
|
||||
const decompress = promisify(zstdDecompress)
|
||||
type Zstd = (bytes: Uint8Array, cb: (err: Error | null, output: Uint8Array) => void) => void
|
||||
|
||||
const api = zlib as unknown as {
|
||||
zstdCompress: Zstd
|
||||
zstdDecompress: Zstd
|
||||
}
|
||||
|
||||
const compress = promisify(api.zstdCompress)
|
||||
const decompress = promisify(api.zstdDecompress)
|
||||
|
||||
export async function compressZstd(bytes: Uint8Array): Promise<Uint8Array> {
|
||||
return compress(bytes) as Promise<Uint8Array>
|
||||
|
||||
Reference in New Issue
Block a user