@ywfe/fe-tools 1.0.2-beta.1 → 1.0.2-beta.11
Sign up to get free protection for your applications and to get access to all the features.
- package/index.ts +2 -0
- package/jest.config.js +12 -0
- package/{dist/bundle.js → lib/ywfe-tools.esm.js} +82 -134
- package/lib/ywfe-tools.esm.js.map +1 -0
- package/package.json +20 -17
- package/request.ts +49 -0
- package/rollup.config.js +73 -0
- package/tsconfig.json +10 -0
- package/tsconfig.type.json +8 -0
- package/userInputToJson.ts +16 -0
- package/dist/bundle.js.map +0 -1
package/index.ts
ADDED
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
|
-
|
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
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
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 });
|
@@ -8819,16 +8777,6 @@ function userInputToJson(_a) {
|
|
8819
8777
|
});
|
8820
8778
|
}
|
8821
8779
|
|
8822
|
-
|
8823
|
-
|
8824
|
-
|
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
|
8780
|
+
exports.request = request;
|
8781
|
+
exports.userInputToJson = userInputToJson;
|
8782
|
+
//# sourceMappingURL=ywfe-tools.esm.js.map
|