@middy/http-content-encoding 3.0.0-alpha.5 → 3.0.0-alpha.6

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 +4 -1
  2. package/package.json +4 -4
package/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import stream, { Readable, Writable } from 'stream';
2
+ import eventEmitter from 'events';
2
3
  import { promisify } from 'util';
3
4
  import { createBrotliCompress, createGzip, createDeflate } from 'zlib';
4
5
  import { normalizeHttpResponse } from '@middy/util';
@@ -85,7 +86,9 @@ const httpContentEncodingMiddleware = opts => {
85
86
  };
86
87
  };
87
88
 
88
- const isReadableStream = stream => typeof (stream === null || stream === void 0 ? void 0 : stream.pipe) === 'function' && (stream === null || stream === void 0 ? void 0 : stream.readable) !== false && typeof (stream === null || stream === void 0 ? void 0 : stream._read) === 'function' && typeof (stream === null || stream === void 0 ? void 0 : stream._readableState) === 'object';
89
+ const isReadableStream = stream => {
90
+ return stream instanceof eventEmitter && stream.readable !== false;
91
+ };
89
92
 
90
93
  const polyfillPipelinePromise = () => {
91
94
  if (process.version < 'v15.0.0') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@middy/http-content-encoding",
3
- "version": "3.0.0-alpha.5",
3
+ "version": "3.0.0-alpha.6",
4
4
  "description": "Http content encoding middleware for the middy framework",
5
5
  "type": "module",
6
6
  "engines": {
@@ -51,10 +51,10 @@
51
51
  },
52
52
  "homepage": "https://github.com/middyjs/middy#readme",
53
53
  "dependencies": {
54
- "@middy/util": "^3.0.0-alpha.5"
54
+ "@middy/util": "^3.0.0-alpha.6"
55
55
  },
56
56
  "devDependencies": {
57
- "@middy/core": "^3.0.0-alpha.5"
57
+ "@middy/core": "^3.0.0-alpha.6"
58
58
  },
59
- "gitHead": "cf6a1b02a2e163bea353b10146d67e0d95ef8072"
59
+ "gitHead": "176660ed3e0716d6bfb635c77251b301e0e24720"
60
60
  }