kbfetch 1.0.2 → 1.0.4
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/index.js +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -38,7 +38,6 @@ var defaultKbFetch = {
|
|
|
38
38
|
const _init = Object.assign(defOpts, init);
|
|
39
39
|
help_default.objSetDefVal(_init, "headers", baseHeaders);
|
|
40
40
|
help_default.objSetDefVal(_init, "params", baseParams);
|
|
41
|
-
baseBody && _init.headers?.["Content-Type"] === "application/json" && help_default.objSetDefVal(_init, "body", baseBody);
|
|
42
41
|
let { parser, after, timeout, canAbort, ...requestInit } = _init.before(_init) || _init;
|
|
43
42
|
let abortController;
|
|
44
43
|
let timeoutIns;
|
|
@@ -55,6 +54,7 @@ var defaultKbFetch = {
|
|
|
55
54
|
if (requestInit.body && requestInit.body.constructor.name === "Object" && requestInit.headers?.["Content-Type"] !== "application/json") {
|
|
56
55
|
requestInit.headers ||= {};
|
|
57
56
|
requestInit.headers["Content-Type"] == "application/json";
|
|
57
|
+
baseBody && help_default.objSetDefVal(requestInit, "body", baseBody);
|
|
58
58
|
requestInit.body = JSON.stringify(requestInit.body);
|
|
59
59
|
}
|
|
60
60
|
requestInit.headers && (requestInit.headers = help_default.obj2header(requestInit.headers));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kbfetch",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index.js",
|
|
6
6
|
"devDependencies": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
],
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"scripts": {
|
|
24
|
-
"pub": "bun bld && bun tsc && npm publish --registry https://registry.npmjs.org/
|
|
24
|
+
"pub": "bun bld && bun tsc && npm publish --registry https://registry.npmjs.org/ && bun updatetaobao ",
|
|
25
25
|
"patch": "git stash && npm version patch && git stash pop",
|
|
26
26
|
"updatetaobao": "cnpm sync kbfetch",
|
|
27
27
|
"tsc": "tsc index.ts -d --emitDeclarationOnly --declarationDir ./dist/typings",
|