summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/zlib.ts
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2023-06-24 16:12:08 +0200
committerGitHub <noreply@github.com>2023-06-24 19:42:08 +0530
commit4a18c761351dccb146973793cf22e6efffff18bf (patch)
tree35f23a7f6c64c0a9f28a5f0e21d6ecbd378a5c28 /ext/node/polyfills/zlib.ts
parent7a8df8f00cce29605b2d74cb32b255d482f29dda (diff)
fix(ext/node): support brotli APIs (#19223)
Co-authored-by: Bartek IwaƄczuk <biwanczuk@gmail.com>
Diffstat (limited to 'ext/node/polyfills/zlib.ts')
-rw-r--r--ext/node/polyfills/zlib.ts42
1 files changed, 24 insertions, 18 deletions
diff --git a/ext/node/polyfills/zlib.ts b/ext/node/polyfills/zlib.ts
index 07bc65c2d..33f17fc4e 100644
--- a/ext/node/polyfills/zlib.ts
+++ b/ext/node/polyfills/zlib.ts
@@ -32,11 +32,29 @@ import {
unzip,
unzipSync,
} from "ext:deno_node/_zlib.mjs";
+import {
+ brotliCompress,
+ brotliCompressSync,
+ brotliDecompress,
+ brotliDecompressSync,
+ createBrotliCompress,
+ createBrotliDecompress,
+} from "ext:deno_node/_brotli.js";
+
export class Options {
constructor() {
notImplemented("Options.prototype.constructor");
}
}
+
+interface IBrotliOptions {
+ flush?: number;
+ finishFlush?: number;
+ chunkSize?: number;
+ params?: Record<number, number>;
+ maxOutputLength?: number;
+}
+
export class BrotliOptions {
constructor() {
notImplemented("BrotliOptions.prototype.constructor");
@@ -58,24 +76,6 @@ export class ZlibBase {
}
}
export { constants };
-export function createBrotliCompress() {
- notImplemented("createBrotliCompress");
-}
-export function createBrotliDecompress() {
- notImplemented("createBrotliDecompress");
-}
-export function brotliCompress() {
- notImplemented("brotliCompress");
-}
-export function brotliCompressSync() {
- notImplemented("brotliCompressSync");
-}
-export function brotliDecompress() {
- notImplemented("brotliDecompress");
-}
-export function brotliDecompressSync() {
- notImplemented("brotliDecompressSync");
-}
export default {
Options,
@@ -122,7 +122,13 @@ export default {
};
export {
+ brotliCompress,
+ brotliCompressSync,
+ brotliDecompress,
+ brotliDecompressSync,
codes,
+ createBrotliCompress,
+ createBrotliDecompress,
createDeflate,
createDeflateRaw,
createGunzip,