@ywfe/fe-tools 1.2.1-beta.24 → 1.2.1-beta.26

Sign up to get free protection for your applications and to get access to all the features.
@@ -8721,12 +8721,12 @@ function request(_a) {
8721
8721
  return basePathMap.get(env);
8722
8722
  };
8723
8723
  isValidURL = function (url) {
8724
- var pattern = new RegExp("^(https?:\\/\\/)?" + // protocol
8725
- "((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|" + // domain name
8726
- "((\\d{1,3}\\.){3}\\d{1,3}))" + // OR ip (v4) address
8727
- "(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*" + // port and path
8728
- "(\\?[;&a-z\\d%_.~+=-]*)?" + // query string
8729
- "(\\#[-a-z\\d_]*)?$", "i"); // fragment locator
8724
+ var pattern = new RegExp("^(https?:\/\/)?" + // protocol
8725
+ "((([a-z\d]([a-z\d-]*[a-z\d])*)\.)+[a-z]{2,}|" + // domain name
8726
+ "((\d{1,3}\.){3}\d{1,3}))" + // OR ip (v4) address
8727
+ "(\:\d+)?(\/[-a-z\d%_.~+]*)*" + // port and path
8728
+ "(\?[;&a-z\d%_.~+=-]*)?" + // query string
8729
+ "(\#[-a-z\d_]*)?$", "i"); // fragment locator
8730
8730
  return !!pattern.test(url);
8731
8731
  };
8732
8732
  prefix = getBasePath();
@@ -8760,47 +8760,21 @@ function request(_a) {
8760
8760
  });
8761
8761
  }
8762
8762
 
8763
- function userInputToJson(_a) {
8764
- return __awaiter(this, arguments, void 0, function (_b) {
8765
- var res, result;
8766
- var input = _b.input;
8767
- return __generator(this, function (_c) {
8768
- switch (_c.label) {
8769
- case 0:
8770
- console.log("input", input);
8771
- return [4 /*yield*/, request({
8772
- input: {
8773
- url: "https://fc-typechat.ywwl.com/userInputToJson",
8774
- method: "GET",
8775
- params: input,
8776
- },
8777
- })];
8778
- case 1:
8779
- res = _c.sent();
8780
- if (res.success) {
8781
- result = res.data;
8782
- return [2 /*return*/, result.success ? result.data : result];
8783
- }
8784
- else {
8785
- return [2 /*return*/, res.success ? res.data : res];
8786
- }
8787
- }
8788
- });
8789
- });
8790
- }
8791
-
8792
8763
  // Ctrl-S保存代码
8793
8764
  function JSON2String(_a) {
8794
8765
  var input = _a.input;
8795
8766
  var data = input.data;
8767
+ var result = { content: '' };
8796
8768
  try {
8797
8769
  var str = JSON.stringify(data);
8798
- return '```json' + str + 'json```';
8770
+ result.content = '```json' + str + 'json```';
8771
+ return result;
8799
8772
  }
8800
8773
  catch (error) {
8801
- return '```json' + '{}' + 'json```';
8774
+ result.content = '```json' + '{}' + 'json```';
8775
+ return result;
8802
8776
  }
8803
8777
  }
8804
8778
 
8805
- export { JSON2String, request, userInputToJson };
8779
+ export { JSON2String, request };
8806
8780
  //# sourceMappingURL=ywfe-tools.esm.js.map