summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/_brotli.js
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2024-08-11 01:56:30 -0700
committerGitHub <noreply@github.com>2024-08-11 14:26:30 +0530
commitfeba133711d0ab79528134d05f1e38168305adfc (patch)
tree13e3a5de54d716693492e91eb41bd88613a0593f /ext/node/polyfills/_brotli.js
parent82884348cb1b424a4c4452ef734bc4e760926b2f (diff)
fix(ext/node): createBrotliCompress params (#24984)
Fixes https://github.com/denoland/deno/issues/24416
Diffstat (limited to 'ext/node/polyfills/_brotli.js')
-rw-r--r--ext/node/polyfills/_brotli.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/ext/node/polyfills/_brotli.js b/ext/node/polyfills/_brotli.js
index 6b4020724..0dcb58e04 100644
--- a/ext/node/polyfills/_brotli.js
+++ b/ext/node/polyfills/_brotli.js
@@ -3,9 +3,11 @@
import { core, primordials } from "ext:core/mod.js";
const {
Uint8Array,
+ Number,
PromisePrototypeThen,
PromisePrototypeCatch,
- ObjectValues,
+ ObjectEntries,
+ ArrayPrototypeMap,
TypedArrayPrototypeSlice,
TypedArrayPrototypeSubarray,
TypedArrayPrototypeGetByteLength,
@@ -114,7 +116,11 @@ export class BrotliCompress extends Transform {
},
});
- const params = ObjectValues(options?.params ?? {});
+ const params = ArrayPrototypeMap(
+ ObjectEntries(options?.params ?? {}),
+ // Undo the stringification of the keys
+ (o) => [Number(o[0]), o[1]],
+ );
this.#context = op_create_brotli_compress(params);
const context = this.#context;
}