keryx 0.14.1 → 0.14.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keryx",
3
- "version": "0.14.1",
3
+ "version": "0.14.2",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -111,9 +111,8 @@ export async function compressResponse(
111
111
  // Compress the buffered body
112
112
  const format: Bun.CompressionFormat = encoding === "br" ? "brotli" : "gzip";
113
113
  // @ts-ignore Bun supports "brotli" as CompressionFormat but DOM lib does not
114
- const stream = new Blob([body])
115
- .stream()
116
- .pipeThrough(new CompressionStream(format));
114
+ const compressionStream = new CompressionStream(format);
115
+ const stream = new Blob([body]).stream().pipeThrough(compressionStream);
117
116
 
118
117
  const headers = new Headers(response.headers);
119
118
  headers.set("Content-Encoding", encoding);
@@ -129,7 +128,8 @@ export async function compressResponse(
129
128
  // Content-Length is present and above threshold — stream-compress
130
129
  const format: Bun.CompressionFormat = encoding === "br" ? "brotli" : "gzip";
131
130
  // @ts-ignore Bun supports "brotli" as CompressionFormat but DOM lib does not
132
- const stream = response.body.pipeThrough(new CompressionStream(format));
131
+ const compressionStream = new CompressionStream(format);
132
+ const stream = response.body.pipeThrough(compressionStream);
133
133
 
134
134
  const headers = new Headers(response.headers);
135
135
  headers.set("Content-Encoding", encoding);