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

Sign up to get free protection for your applications and to get access to all the features.
package/index.ts ADDED
@@ -0,0 +1 @@
1
+ export { default as request } from './request'
package/jest.config.js ADDED
@@ -0,0 +1,12 @@
1
+ module.exports = {
2
+ preset: 'ts-jest',
3
+ testEnvironment: 'jsdom',
4
+ moduleFileExtensions: ['js', 'jsx', 'json', 'ts', 'tsx'],
5
+ rootDir: '.',
6
+ roots: ['<rootDir>/src/'],
7
+ testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?|ts?)$',
8
+ transform: {
9
+ '^.+\\.(t|j)s$': 'ts-jest',
10
+ '^.+\\.(t|j)sx$': 'ts-jest',
11
+ },
12
+ };
@@ -1,4 +1,4 @@
1
- import require$$1 from 'fs';
1
+ 'use strict';
2
2
 
3
3
  /******************************************************************************
4
4
  Copyright (c) Microsoft Corporation.
@@ -13,131 +13,89 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13
13
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
14
14
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15
15
  PERFORMANCE OF THIS SOFTWARE.
16
- ***************************************************************************** */
17
- /* global Reflect, Promise, SuppressedError, Symbol */
16
+ ***************************************************************************** */
17
+ /* global Reflect, Promise, SuppressedError, Symbol */
18
+
19
+
20
+ function __awaiter(thisArg, _arguments, P, generator) {
21
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
22
+ return new (P || (P = Promise))(function (resolve, reject) {
23
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
24
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
25
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
26
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
27
+ });
28
+ }
29
+
30
+ function __generator(thisArg, body) {
31
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
32
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
33
+ function verb(n) { return function (v) { return step([n, v]); }; }
34
+ function step(op) {
35
+ if (f) throw new TypeError("Generator is already executing.");
36
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
37
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
38
+ if (y = 0, t) op = [op[0] & 2, t.value];
39
+ switch (op[0]) {
40
+ case 0: case 1: t = op; break;
41
+ case 4: _.label++; return { value: op[1], done: false };
42
+ case 5: _.label++; y = op[1]; op = [0]; continue;
43
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
44
+ default:
45
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
46
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
47
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
48
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
49
+ if (t[2]) _.ops.pop();
50
+ _.trys.pop(); continue;
51
+ }
52
+ op = body.call(thisArg, _);
53
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
54
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
55
+ }
56
+ }
57
+
58
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
59
+ var e = new Error(message);
60
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
61
+ };
18
62
 
19
- function __awaiter(thisArg, _arguments, P, generator) {
20
- function adopt(value) {
21
- return value instanceof P ? value : new P(function (resolve) {
22
- resolve(value);
23
- });
24
- }
25
- return new (P || (P = Promise))(function (resolve, reject) {
26
- function fulfilled(value) {
27
- try {
28
- step(generator.next(value));
29
- } catch (e) {
30
- reject(e);
31
- }
32
- }
33
- function rejected(value) {
34
- try {
35
- step(generator["throw"](value));
36
- } catch (e) {
37
- reject(e);
38
- }
39
- }
40
- function step(result) {
41
- result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
42
- }
43
- step((generator = generator.apply(thisArg, _arguments || [])).next());
44
- });
45
- }
46
- function __generator(thisArg, body) {
47
- var _ = {
48
- label: 0,
49
- sent: function () {
50
- if (t[0] & 1) throw t[1];
51
- return t[1];
52
- },
53
- trys: [],
54
- ops: []
55
- },
56
- f,
57
- y,
58
- t,
59
- g;
60
- return g = {
61
- next: verb(0),
62
- "throw": verb(1),
63
- "return": verb(2)
64
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
65
- return this;
66
- }), g;
67
- function verb(n) {
68
- return function (v) {
69
- return step([n, v]);
70
- };
71
- }
72
- function step(op) {
73
- if (f) throw new TypeError("Generator is already executing.");
74
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
75
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
76
- if (y = 0, t) op = [op[0] & 2, t.value];
77
- switch (op[0]) {
78
- case 0:
79
- case 1:
80
- t = op;
81
- break;
82
- case 4:
83
- _.label++;
84
- return {
85
- value: op[1],
86
- done: false
87
- };
88
- case 5:
89
- _.label++;
90
- y = op[1];
91
- op = [0];
92
- continue;
93
- case 7:
94
- op = _.ops.pop();
95
- _.trys.pop();
96
- continue;
97
- default:
98
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
99
- _ = 0;
100
- continue;
101
- }
102
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
103
- _.label = op[1];
104
- break;
105
- }
106
- if (op[0] === 6 && _.label < t[1]) {
107
- _.label = t[1];
108
- t = op;
109
- break;
110
- }
111
- if (t && _.label < t[2]) {
112
- _.label = t[2];
113
- _.ops.push(op);
114
- break;
115
- }
116
- if (t[2]) _.ops.pop();
117
- _.trys.pop();
118
- continue;
119
- }
120
- op = body.call(thisArg, _);
121
- } catch (e) {
122
- op = [6, e];
123
- y = 0;
124
- } finally {
125
- f = t = 0;
126
- }
127
- if (op[0] & 5) throw op[1];
128
- return {
129
- value: op[0] ? op[1] : void 0,
130
- done: true
131
- };
132
- }
63
+ function getAugmentedNamespace(n) {
64
+ if (n.__esModule) return n;
65
+ var f = n.default;
66
+ if (typeof f == "function") {
67
+ var a = function a () {
68
+ if (this instanceof a) {
69
+ return Reflect.construct(f, arguments, this.constructor);
70
+ }
71
+ return f.apply(this, arguments);
72
+ };
73
+ a.prototype = f.prototype;
74
+ } else a = {};
75
+ Object.defineProperty(a, '__esModule', {value: true});
76
+ Object.keys(n).forEach(function (k) {
77
+ var d = Object.getOwnPropertyDescriptor(n, k);
78
+ Object.defineProperty(a, k, d.get ? d : {
79
+ enumerable: true,
80
+ get: function () {
81
+ return n[k];
82
+ }
83
+ });
84
+ });
85
+ return a;
133
86
  }
134
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
135
- var e = new Error(message);
136
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
137
- };
138
87
 
139
88
  var ywfeUtils_esm = {};
140
89
 
90
+ var empty = {};
91
+
92
+ var empty$1 = /*#__PURE__*/Object.freeze({
93
+ __proto__: null,
94
+ default: empty
95
+ });
96
+
97
+ var require$$1 = /*@__PURE__*/getAugmentedNamespace(empty$1);
98
+
141
99
  (function (exports) {
142
100
 
143
101
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -8797,38 +8755,5 @@ function request(_a) {
8797
8755
  });
8798
8756
  }
8799
8757
 
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 };
8834
- //# sourceMappingURL=bundle.js.map
8758
+ exports.request = request;
8759
+ //# sourceMappingURL=ywfe-tools.esm.js.map