mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-31 07:23:06 +08:00
promisify(zlib.deflate) and the other callback one-shots (inflate, deflateRaw, inflateRaw, gzip, gunzip, unzip) over a named or namespace import of node:zlib now lower. A call through the binding, gzipAsync(data, options?), runs the callback form's work on the worker pool and returns a promise that settles where the callback would run: fulfilled with the Buffer, or rejected with the callback form's Error (errno, code and message). An invalid option or input rejects the promise instead of throwing, as the throw inside Node's promisify wrapper does. The runtime adds scr_zlib_codec_promise and its checked-dynamic twin, which share the callback forms' options ladder and worker-pool operation and settle a pending promise in place of the callback. The fallback declarations gain the matching util.promisify overload.