@ywfe/fe-tools 1.2.1-beta.29 → 1.2.1-beta.30

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,5 +4,9 @@ interface userInput {
4
4
  }
5
5
  declare function userInputToJson({ input }: {
6
6
  input: userInput;
7
- }): Promise<any>;
7
+ }): Promise<{
8
+ message: string;
9
+ success: boolean;
10
+ data: any;
11
+ }>;
8
12
  export default userInputToJson;
@@ -8727,6 +8727,7 @@ function request(_a) {
8727
8727
  "((([a-z\d]([a-z\d-]*[a-z\d])*)\.)+[a-z]{2,}|" + // domain name
8728
8728
  "((\d{1,3}\.){3}\d{1,3}))" + // OR ip (v4) address
8729
8729
  "(\:\d+)?(\/[-a-z\d%_.&#126;+]*)*" + // port and path
8730
+ "(\?[;&a-z\d%_.&#126;+=-]*)?" + // query string
8730
8731
  "(\#[-a-z\d_]*)?$", "i"); // fragment locator
8731
8732
  return !!pattern.test(url);
8732
8733
  };
@@ -8763,28 +8764,20 @@ function request(_a) {
8763
8764
 
8764
8765
  function userInputToJson(_a) {
8765
8766
  return __awaiter(this, arguments, void 0, function (_b) {
8766
- var res, result;
8767
+ var res;
8767
8768
  var input = _b.input;
8768
8769
  return __generator(this, function (_c) {
8769
8770
  switch (_c.label) {
8770
- case 0:
8771
- console.log("input", input);
8772
- return [4 /*yield*/, request({
8773
- input: {
8774
- url: "https://fc-typechat.ywwl.com/userInputToJson",
8775
- method: "GET",
8776
- params: input,
8777
- },
8778
- })];
8771
+ case 0: return [4 /*yield*/, request({
8772
+ input: {
8773
+ url: "https://fc-typechat.ywwl.com/userInputToJson",
8774
+ method: "GET",
8775
+ params: input,
8776
+ },
8777
+ })];
8779
8778
  case 1:
8780
8779
  res = _c.sent();
8781
- if (res.success) {
8782
- result = res.data;
8783
- return [2 /*return*/, result.success ? result.data : result];
8784
- }
8785
- else {
8786
- return [2 /*return*/, res.success ? res.data : res];
8787
- }
8780
+ return [2 /*return*/, res];
8788
8781
  }
8789
8782
  });
8790
8783
  });