From 4339a6c55db8252b54ee96e38e2e1b084e28d7e2 Mon Sep 17 00:00:00 2001 From: Jovi De Croock Date: Sun, 31 Dec 2023 12:53:09 +0100 Subject: fix(node/zlib): consistently return buffer (#21747) This fixes point 3 of https://github.com/denoland/deno/issues/20516 This PR creates consistency between the sync and async versions of the brotli compress where we will always return a buffer like Node. --- ext/node/polyfills/_brotli.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/node') diff --git a/ext/node/polyfills/_brotli.js b/ext/node/polyfills/_brotli.js index cd54eedda..d39f2d5f6 100644 --- a/ext/node/polyfills/_brotli.js +++ b/ext/node/polyfills/_brotli.js @@ -126,7 +126,7 @@ export function brotliCompress( const { quality, lgwin, mode } = oneOffCompressOptions(options); op_brotli_compress_async(buf, quality, lgwin, mode) - .then((result) => callback(null, result)) + .then((result) => callback(null, Buffer.from(result))) .catch((err) => callback(err)); } -- cgit v1.2.3