summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/_brotli.js
diff options
context:
space:
mode:
authorJovi De Croock <decroockjovi@gmail.com>2023-12-31 12:53:09 +0100
committerGitHub <noreply@github.com>2023-12-31 17:23:09 +0530
commit4339a6c55db8252b54ee96e38e2e1b084e28d7e2 (patch)
tree3144e20bd466a32b6ecc0be707731950acca52eb /ext/node/polyfills/_brotli.js
parent08fc8d50e35a27835d497a631a6dcc0f733546de (diff)
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.
Diffstat (limited to 'ext/node/polyfills/_brotli.js')
-rw-r--r--ext/node/polyfills/_brotli.js2
1 files changed, 1 insertions, 1 deletions
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));
}