@middy/http-content-encoding 6.4.4 → 7.0.0-alpha.1

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.
Files changed (2) hide show
  1. package/index.js +5 -8
  2. package/package.json +5 -5
package/index.js CHANGED
@@ -4,21 +4,23 @@ import {
4
4
  createBrotliCompress as brotliCompressStream,
5
5
  createDeflate as deflateCompressStream,
6
6
  createGzip as gzipCompressStream,
7
+ createZstdCompress as zstdCompressStream,
7
8
  } from "node:zlib";
8
9
 
9
10
  import { normalizeHttpResponse } from "@middy/util";
10
11
 
11
12
  const contentEncodingStreams = {
12
13
  br: brotliCompressStream,
13
- gzip: gzipCompressStream,
14
14
  deflate: deflateCompressStream,
15
+ gzip: gzipCompressStream,
16
+ zstd: zstdCompressStream,
15
17
  };
16
18
 
17
19
  const defaults = {
18
20
  br: undefined,
19
- // zstd: undefined,
20
- gzip: undefined,
21
21
  deflate: undefined,
22
+ gzip: undefined,
23
+ zstd: undefined,
22
24
  overridePreferredEncoding: [],
23
25
  };
24
26
 
@@ -26,11 +28,6 @@ export const getStream = (preferredEncoding) => {
26
28
  return contentEncodingStreams[preferredEncoding]();
27
29
  };
28
30
 
29
- /*
30
- * `zstd` disabled due to lack of support in nodejs
31
- * https://github.com/andrew-aladev/brotli-vs-zstd
32
- */
33
-
34
31
  const httpContentEncodingMiddleware = (opts) => {
35
32
  const options = { ...defaults, ...opts };
36
33
 
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@middy/http-content-encoding",
3
- "version": "6.4.4",
3
+ "version": "7.0.0-alpha.1",
4
4
  "description": "Http content encoding middleware for the middy framework",
5
5
  "type": "module",
6
6
  "engines": {
7
- "node": ">=20"
7
+ "node": ">=22"
8
8
  },
9
9
  "engineStrict": true,
10
10
  "publishConfig": {
@@ -67,11 +67,11 @@
67
67
  "url": "https://github.com/sponsors/willfarrell"
68
68
  },
69
69
  "dependencies": {
70
- "@middy/util": "6.4.4"
70
+ "@middy/util": "7.0.0-alpha.1"
71
71
  },
72
72
  "devDependencies": {
73
- "@datastream/core": "0.0.40",
74
- "@middy/core": "6.4.4"
73
+ "@datastream/core": "0.0.41",
74
+ "@middy/core": "7.0.0-alpha.1"
75
75
  },
76
76
  "gitHead": "7a6c0fbb8ab71d6a2171e678697de9f237568431"
77
77
  }