@ywfe/fe-tools 1.0.2-beta.0 → 1.0.2-beta.1

Sign up to get free protection for your applications and to get access to all the features.
package/dist/bundle.js CHANGED
@@ -136,28 +136,6 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
136
136
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
137
137
  };
138
138
 
139
- function userInputToJson(_a) {
140
- return __awaiter(this, arguments, void 0, function (_b) {
141
- var res;
142
- var input = _b.input;
143
- return __generator(this, function (_c) {
144
- switch (_c.label) {
145
- case 0:
146
- input.userInput, input.rules;
147
- return [4 /*yield*/, feTools.request({
148
- input: {
149
- url: "https://fc-typechat.ywwl.com/userInputToJson",
150
- method: "GET"
151
- }
152
- })];
153
- case 1:
154
- res = _c.sent();
155
- return [2 /*return*/, res];
156
- }
157
- });
158
- });
159
- }
160
-
161
139
  var ywfeUtils_esm = {};
162
140
 
163
141
  (function (exports) {
@@ -8819,5 +8797,38 @@ function request(_a) {
8819
8797
  });
8820
8798
  }
8821
8799
 
8822
- export { request, userInputToJson };
8800
+ function userInputToJson(_a) {
8801
+ return __awaiter(this, arguments, void 0, function (_b) {
8802
+ var res;
8803
+ var input = _b.input;
8804
+ return __generator(this, function (_c) {
8805
+ switch (_c.label) {
8806
+ case 0:
8807
+ input.userInput, input.rules;
8808
+ return [4 /*yield*/, feTools.request({
8809
+ input: {
8810
+ url: "https://fc-typechat.ywwl.com/userInputToJson",
8811
+ method: "GET"
8812
+ }
8813
+ })];
8814
+ case 1:
8815
+ res = _c.sent();
8816
+ return [2 /*return*/, res];
8817
+ }
8818
+ });
8819
+ });
8820
+ }
8821
+
8822
+ function JSON2String(_a) {
8823
+ var input = _a.input;
8824
+ var _b = input.data, data = _b === void 0 ? {} : _b;
8825
+ try {
8826
+ return "```json" + JSON.stringify(data) + "json```";
8827
+ }
8828
+ catch (error) {
8829
+ return "```json" + JSON.stringify({}) + "json```";
8830
+ }
8831
+ }
8832
+
8833
+ export { JSON2String, request, userInputToJson };
8823
8834
  //# sourceMappingURL=bundle.js.map