@modern-js/create-request 2.58.1 → 2.58.3

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.
@@ -93,7 +93,6 @@ const createRequest = (path, method, port, httpMethodDecider = "functionName", f
93
93
  } else if (payload.formUrlencoded) {
94
94
  headers["Content-Type"] = "application/x-www-form-urlencoded";
95
95
  if (typeof payload.formUrlencoded === "object" && // @ts-expect-error
96
- // eslint-disable-next-line node/prefer-global/url-search-params,node/no-unsupported-features/node-builtins
97
96
  !(payload.formUrlencoded instanceof URLSearchParams)) {
98
97
  body = (0, import_query_string.stringify)(payload.formUrlencoded);
99
98
  } else {
package/dist/cjs/node.js CHANGED
@@ -32,9 +32,9 @@ __export(node_exports, {
32
32
  createRequest: () => createRequest
33
33
  });
34
34
  module.exports = __toCommonJS(node_exports);
35
+ var import_node = require("@modern-js/runtime-utils/node");
35
36
  var import_node_fetch = __toESM(require("node-fetch"));
36
37
  var import_path_to_regexp = require("path-to-regexp");
37
- var import_node = require("@modern-js/runtime-utils/node");
38
38
  var import_query_string = require("query-string");
39
39
  var import_handleRes = require("./handleRes");
40
40
  let realRequest;
@@ -81,7 +81,6 @@ var createRequest = function(path, method, port) {
81
81
  } else if (payload.formUrlencoded) {
82
82
  headers["Content-Type"] = "application/x-www-form-urlencoded";
83
83
  if (typeof payload.formUrlencoded === "object" && // @ts-expect-error
84
- // eslint-disable-next-line node/prefer-global/url-search-params,node/no-unsupported-features/node-builtins
85
84
  !_instanceof(payload.formUrlencoded, URLSearchParams)) {
86
85
  body = stringify(payload.formUrlencoded);
87
86
  } else {
package/dist/esm/node.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
2
2
  import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
3
+ import { useHeaders } from "@modern-js/runtime-utils/node";
3
4
  import nodeFetch from "node-fetch";
4
5
  import { compile, pathToRegexp } from "path-to-regexp";
5
- import { useHeaders } from "@modern-js/runtime-utils/node";
6
6
  import { stringify } from "query-string";
7
7
  import { handleRes } from "./handleRes";
8
8
  var realRequest;
@@ -69,7 +69,6 @@ const createRequest = (path, method, port, httpMethodDecider = "functionName", f
69
69
  } else if (payload.formUrlencoded) {
70
70
  headers["Content-Type"] = "application/x-www-form-urlencoded";
71
71
  if (typeof payload.formUrlencoded === "object" && // @ts-expect-error
72
- // eslint-disable-next-line node/prefer-global/url-search-params,node/no-unsupported-features/node-builtins
73
72
  !(payload.formUrlencoded instanceof URLSearchParams)) {
74
73
  body = stringify(payload.formUrlencoded);
75
74
  } else {
@@ -1,6 +1,6 @@
1
+ import { useHeaders } from "@modern-js/runtime-utils/node";
1
2
  import nodeFetch from "node-fetch";
2
3
  import { compile, pathToRegexp } from "path-to-regexp";
3
- import { useHeaders } from "@modern-js/runtime-utils/node";
4
4
  import { stringify } from "query-string";
5
5
  import { handleRes } from "./handleRes";
6
6
  let realRequest;
@@ -1,3 +1,3 @@
1
- import type { RequestCreator, IOptions } from './types';
1
+ import type { IOptions, RequestCreator } from './types';
2
2
  export declare const configure: (options: IOptions) => void;
3
3
  export declare const createRequest: RequestCreator;
@@ -1,3 +1,3 @@
1
- import { Response as NodeResponse } from 'node-fetch';
1
+ import type { Response as NodeResponse } from 'node-fetch';
2
2
  declare const handleRes: (res: Response | NodeResponse) => Promise<any>;
3
3
  export { handleRes };
@@ -1,4 +1,4 @@
1
1
  import nodeFetch from 'node-fetch';
2
- import type { RequestCreator, IOptions } from './types';
2
+ import type { IOptions, RequestCreator } from './types';
3
3
  export declare const configure: (options: IOptions<typeof nodeFetch>) => void;
4
4
  export declare const createRequest: RequestCreator<typeof nodeFetch>;
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.58.1",
18
+ "version": "2.58.3",
19
19
  "jsnext:source": "./src/node.ts",
20
20
  "types": "./dist/types/browser.d.ts",
21
21
  "main": "./dist/cjs/node.js",
@@ -65,8 +65,8 @@
65
65
  "node-fetch": "^2.6.1",
66
66
  "path-to-regexp": "^6.2.0",
67
67
  "query-string": "^7.1.1",
68
- "@modern-js/runtime-utils": "2.58.1",
69
- "@modern-js/utils": "2.58.1"
68
+ "@modern-js/runtime-utils": "2.58.3",
69
+ "@modern-js/utils": "2.58.3"
70
70
  },
71
71
  "devDependencies": {
72
72
  "@types/jest": "^29",
@@ -76,9 +76,9 @@
76
76
  "jest": "^29",
77
77
  "nock": "^13.2.1",
78
78
  "typescript": "^5",
79
- "@modern-js/types": "2.58.1",
80
- "@scripts/jest-config": "2.58.1",
81
- "@scripts/build": "2.58.1"
79
+ "@modern-js/types": "2.58.3",
80
+ "@scripts/build": "2.58.3",
81
+ "@scripts/jest-config": "2.58.3"
82
82
  },
83
83
  "sideEffects": false,
84
84
  "publishConfig": {