@modern-js/create-request 2.5.1-alpha.6 → 2.5.1-alpha.7

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.
@@ -43,7 +43,7 @@ const configure = (options) => {
43
43
  realAllowedHeaders = allowedHeaders;
44
44
  }
45
45
  };
46
- const createRequest = (path, method, httpMethodDecider = "functionName", port, fetch2 = originFetch) => {
46
+ const createRequest = (path, method, port, httpMethodDecider = "functionName", fetch2 = originFetch) => {
47
47
  const getFinalPath = (0, import_path_to_regexp.compile)(path, { encode: encodeURIComponent });
48
48
  const keys = [];
49
49
  (0, import_path_to_regexp.pathToRegexp)(path, keys);
package/dist/cjs/node.js CHANGED
@@ -45,7 +45,7 @@ const configure = (options) => {
45
45
  realAllowedHeaders = allowedHeaders;
46
46
  }
47
47
  };
48
- const createRequest = (path, method, httpMethodDecider = "functionName", port, fetch = import_node_fetch.default) => {
48
+ const createRequest = (path, method, port, httpMethodDecider = "functionName", fetch = import_node_fetch.default) => {
49
49
  const getFinalPath = (0, import_path_to_regexp.compile)(path, { encode: encodeURIComponent });
50
50
  const keys = [];
51
51
  (0, import_path_to_regexp.pathToRegexp)(path, keys);
@@ -175,8 +175,8 @@ var configure = function(options) {
175
175
  realAllowedHeaders = allowedHeaders;
176
176
  }
177
177
  };
178
- var createRequest = function(path, method) {
179
- var httpMethodDecider = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "functionName", port = arguments.length > 3 ? arguments[3] : void 0, fetch2 = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : originFetch;
178
+ var createRequest = function(path, method, port) {
179
+ var httpMethodDecider = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "functionName", fetch2 = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : originFetch;
180
180
  var getFinalPath = compile(path, {
181
181
  encode: encodeURIComponent
182
182
  });
package/dist/esm/node.js CHANGED
@@ -46,8 +46,8 @@ var configure = function(options) {
46
46
  realAllowedHeaders = allowedHeaders;
47
47
  }
48
48
  };
49
- var createRequest = function(path, method) {
50
- var httpMethodDecider = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "functionName", port = arguments.length > 3 ? arguments[3] : void 0, fetch = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : nodeFetch;
49
+ var createRequest = function(path, method, port) {
50
+ var httpMethodDecider = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "functionName", fetch = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : nodeFetch;
51
51
  var getFinalPath = compile(path, {
52
52
  encode: encodeURIComponent
53
53
  });
@@ -14,7 +14,7 @@ const configure = (options) => {
14
14
  realAllowedHeaders = allowedHeaders;
15
15
  }
16
16
  };
17
- const createRequest = (path, method, httpMethodDecider = "functionName", port, fetch2 = originFetch) => {
17
+ const createRequest = (path, method, port, httpMethodDecider = "functionName", fetch2 = originFetch) => {
18
18
  const getFinalPath = compile(path, { encode: encodeURIComponent });
19
19
  const keys = [];
20
20
  pathToRegexp(path, keys);
@@ -16,7 +16,7 @@ const configure = (options) => {
16
16
  realAllowedHeaders = allowedHeaders;
17
17
  }
18
18
  };
19
- const createRequest = (path, method, httpMethodDecider = "functionName", port, fetch = nodeFetch) => {
19
+ const createRequest = (path, method, port, httpMethodDecider = "functionName", fetch = nodeFetch) => {
20
20
  const getFinalPath = compile(path, { encode: encodeURIComponent });
21
21
  const keys = [];
22
22
  pathToRegexp(path, keys);
@@ -14,7 +14,7 @@ export type Fetch = typeof fetch | typeof nodeFetch;
14
14
  export type Sender = ((...args: any[]) => Promise<any>) & {
15
15
  fetch?: Fetch;
16
16
  };
17
- export type RequestCreator = (path: string, method: string, httpMethodDecider: HttpMethodDecider, port: number, fetch?: Fetch) => Sender;
17
+ export type RequestCreator = (path: string, method: string, port: number, httpMethodDecider: HttpMethodDecider, fetch?: Fetch) => Sender;
18
18
  export type IOptions<F = Fetch> = {
19
19
  request?: F;
20
20
  interceptor?: (request: F) => F;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "2.5.1-alpha.6",
14
+ "version": "2.5.1-alpha.7",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/cjs/index.js",