@ywfe/fe-tools 1.2.1-beta.32 → 1.2.1-beta.33
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/userInputToJson.d.ts +5 -1
- package/lib/ywfe-tools.cjs +11 -19
- package/lib/ywfe-tools.cjs.map +1 -1
- package/lib/ywfe-tools.esm.js +11 -19
- package/lib/ywfe-tools.esm.js.map +1 -1
- package/lib/ywfe-tools.umd.js +2 -2
- package/lib/ywfe-tools.umd.js.map +1 -1
- package/package.json +1 -1
- package/request.ts +1 -2
- package/userInputToJson.ts +3 -7
package/lib/userInputToJson.d.ts
CHANGED
package/lib/ywfe-tools.cjs
CHANGED
@@ -8728,6 +8728,7 @@ function request(_a) {
|
|
8728
8728
|
};
|
8729
8729
|
prefix = getBasePath();
|
8730
8730
|
requestUrl = isValidURL(input.url) ? input.url : "".concat(prefix).concat(input.url);
|
8731
|
+
console.log('requestUrl', requestUrl, isValidURL(input.url));
|
8731
8732
|
fetchOption = {
|
8732
8733
|
method: method,
|
8733
8734
|
headers: {
|
@@ -8746,13 +8747,11 @@ function request(_a) {
|
|
8746
8747
|
response = _c.sent();
|
8747
8748
|
if (!response.ok) {
|
8748
8749
|
message = "An error has occured: ".concat(response.status);
|
8749
|
-
console.log('req result', message);
|
8750
8750
|
return [2 /*return*/, { success: false, message: message }];
|
8751
8751
|
}
|
8752
8752
|
return [4 /*yield*/, response.json()];
|
8753
8753
|
case 2:
|
8754
8754
|
result = _c.sent();
|
8755
|
-
console.log('req result', result);
|
8756
8755
|
return [2 /*return*/, result];
|
8757
8756
|
}
|
8758
8757
|
});
|
@@ -8761,28 +8760,21 @@ function request(_a) {
|
|
8761
8760
|
|
8762
8761
|
function userInputToJson(_a) {
|
8763
8762
|
return __awaiter(this, arguments, void 0, function (_b) {
|
8764
|
-
var res
|
8763
|
+
var res;
|
8765
8764
|
var input = _b.input;
|
8766
8765
|
return __generator(this, function (_c) {
|
8767
8766
|
switch (_c.label) {
|
8768
|
-
case 0:
|
8769
|
-
|
8770
|
-
|
8771
|
-
|
8772
|
-
|
8773
|
-
|
8774
|
-
|
8775
|
-
},
|
8776
|
-
})];
|
8767
|
+
case 0: return [4 /*yield*/, request({
|
8768
|
+
input: {
|
8769
|
+
url: "https://fc-typechat.ywwl.com/userInputToJson",
|
8770
|
+
method: "GET",
|
8771
|
+
params: input,
|
8772
|
+
},
|
8773
|
+
})];
|
8777
8774
|
case 1:
|
8778
8775
|
res = _c.sent();
|
8779
|
-
|
8780
|
-
|
8781
|
-
return [2 /*return*/, result.success ? result.data : result];
|
8782
|
-
}
|
8783
|
-
else {
|
8784
|
-
return [2 /*return*/, res.success ? res.data : res];
|
8785
|
-
}
|
8776
|
+
console.log('userINput1', res);
|
8777
|
+
return [2 /*return*/, res];
|
8786
8778
|
}
|
8787
8779
|
});
|
8788
8780
|
});
|