From feba133711d0ab79528134d05f1e38168305adfc Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Sun, 11 Aug 2024 01:56:30 -0700 Subject: fix(ext/node): createBrotliCompress params (#24984) Fixes https://github.com/denoland/deno/issues/24416 --- ext/node/polyfills/_brotli.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'ext/node') 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; } -- cgit v1.2.3