Skip to content

Commit 5db9db4

Browse files
authored
Swap brotli dependency (#123)
Per @ MaTiAtSIE via #120 (comment) Switch from the older, non-maintained [wasm-brotli](https://github.com/dfrankland/wasm-brotli) to the newer and maintained [brotli-wasm](https://github.com/httptoolkit/brotli-wasm). Drop in swap, all tests still pass. Closes #120
1 parent 3de7eea commit 5db9db4

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

lib/compression.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import zlib from 'zlib'
22
import snappy from 'snappyjs'
3-
import { compress as brotliCompress, decompress as brotliDecompress } from 'wasm-brotli'
3+
import { compress as brotliCompress, decompress as brotliDecompress } from 'brotli-wasm'
44

55
type d_identity = (value: ArrayBuffer | Buffer | Uint8Array ) => ArrayBuffer | Buffer | Uint8Array
66
type d_gzip = (value: ArrayBuffer | Buffer | string ) => Buffer
@@ -64,7 +64,7 @@ async function deflate_brotli(value: Uint8Array) {
6464
lgwin: 22
6565
}
6666
*/)
67-
67+
6868
return Buffer.from(compressedContent);
6969
}
7070

@@ -103,4 +103,4 @@ function buffer_from_result(result: ArrayBuffer | Buffer | Uint8Array): Buffer {
103103
} else {
104104
return Buffer.from(result);
105105
}
106-
}
106+
}

package-lock.json

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"@types/long": "^4.0.2",
2020
"@types/node-int64": "^0.4.29",
2121
"@types/thrift": "^0.10.11",
22+
"brotli-wasm": "^2.0.1",
2223
"browserify-zlib": "^0.2.0",
2324
"bson": "4.6.3",
2425
"cross-fetch": "^3.1.4",
@@ -27,7 +28,6 @@
2728
"snappyjs": "^0.6.1",
2829
"thrift": "0.16.0",
2930
"varint": "^6.0.0",
30-
"wasm-brotli": "^2.0.2",
3131
"xxhash-wasm": "^1.0.2"
3232
},
3333
"devDependencies": {

0 commit comments

Comments
 (0)