@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.
- package/dist/cjs/browser.js +1 -1
- package/dist/cjs/node.js +1 -1
- package/dist/esm/browser.js +2 -2
- package/dist/esm/node.js +2 -2
- package/dist/esm-node/browser.js +1 -1
- package/dist/esm-node/node.js +1 -1
- package/dist/types/types.d.ts +1 -1
- package/package.json +1 -1
package/dist/cjs/browser.js
CHANGED
|
@@ -43,7 +43,7 @@ const configure = (options) => {
|
|
|
43
43
|
realAllowedHeaders = allowedHeaders;
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
|
-
const createRequest = (path, method, httpMethodDecider = "functionName",
|
|
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",
|
|
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);
|
package/dist/esm/browser.js
CHANGED
|
@@ -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 >
|
|
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 >
|
|
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
|
});
|
package/dist/esm-node/browser.js
CHANGED
|
@@ -14,7 +14,7 @@ const configure = (options) => {
|
|
|
14
14
|
realAllowedHeaders = allowedHeaders;
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
|
-
const createRequest = (path, method, httpMethodDecider = "functionName",
|
|
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);
|
package/dist/esm-node/node.js
CHANGED
|
@@ -16,7 +16,7 @@ const configure = (options) => {
|
|
|
16
16
|
realAllowedHeaders = allowedHeaders;
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
|
-
const createRequest = (path, method, httpMethodDecider = "functionName",
|
|
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);
|
package/dist/types/types.d.ts
CHANGED
|
@@ -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,
|
|
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;
|