wreq-js 2.1.0 → 2.1.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.
package/dist/wreq-js.cjs CHANGED
@@ -42,6 +42,7 @@ module.exports = __toCommonJS(wreq_js_exports);
42
42
  var import_node_crypto = require("crypto");
43
43
  var import_node_http = require("http");
44
44
  var import_node_module = require("module");
45
+ var import_node_stream = require("stream");
45
46
  var import_web = require("stream/web");
46
47
 
47
48
  // src/types.ts
@@ -127,7 +128,7 @@ var bodyHandleFinalizer = typeof FinalizationRegistry === "function" ? new Final
127
128
  }) : void 0;
128
129
  var DEFAULT_BROWSER = "chrome_142";
129
130
  var DEFAULT_OS = "macos";
130
- var DEFAULT_REQUEST_TIMEOUT_MS = 3e4;
131
+ var DEFAULT_REQUEST_TIMEOUT_MS = 3e5;
131
132
  var SUPPORTED_OSES = ["windows", "macos", "linux", "android", "ios"];
132
133
  var UTF8_DECODER = new TextDecoder("utf-8");
133
134
  var ephemeralIdCounter = 0;
@@ -593,6 +594,15 @@ var Response = class _Response {
593
594
  );
594
595
  return response.formData();
595
596
  }
597
+ readable() {
598
+ this.assertBodyAvailable();
599
+ this.bodyUsed = true;
600
+ const stream = this.body;
601
+ if (stream === null) {
602
+ return import_node_stream.Readable.from([]);
603
+ }
604
+ return import_node_stream.Readable.fromWeb(stream);
605
+ }
596
606
  clone() {
597
607
  if (this.bodyUsed) {
598
608
  throw new TypeError("Cannot clone a Response whose body is already used");