utils-lib-js 1.6.0 → 1.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,304 +1,239 @@
1
- "use strict";
2
-
3
- var __extends = this && this.__extends || function () {
4
- var extendStatics = function (d, b) {
5
- extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
6
- d.__proto__ = b;
7
- } || function (d, b) {
8
- for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
9
- };
10
- return extendStatics(d, b);
11
- };
12
- return function (d, b) {
13
- if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
14
- extendStatics(d, b);
15
- function __() {
16
- this.constructor = d;
17
- }
18
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
19
- };
20
- }();
21
- var __assign = this && this.__assign || function () {
22
- __assign = Object.assign || function (t) {
23
- for (var s, i = 1, n = arguments.length; i < n; i++) {
24
- s = arguments[i];
25
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
26
- }
27
- return t;
28
- };
29
- return __assign.apply(this, arguments);
30
- };
31
- var __rest = this && this.__rest || function (s, e) {
32
- var t = {};
33
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
34
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
35
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
36
- }
37
- return t;
38
- };
39
- Object.defineProperty(exports, "__esModule", { value: true });
40
- exports.Request = void 0;
41
- var index_js_1 = require("./index.js");
42
- var httpRequest, httpsRequest, parse, CustomAbortController;
43
- if (typeof require !== "undefined") {
44
- CustomAbortController = require("abort-controller");
45
- httpRequest = require("http").request;
46
- httpsRequest = require("https").request;
47
- parse = require("url").parse;
48
- } else if (typeof AbortController !== "undefined") {
49
- CustomAbortController = AbortController;
50
- } else {
51
- CustomAbortController = function () {
52
- throw new Error('AbortController is not defined');
53
- };
54
- }
55
- var Interceptors = function () {
56
- function Interceptors() {}
57
- Interceptors.prototype.use = function (type, fn) {
58
- switch (type) {
59
- case "request":
60
- this.requestSuccess = fn;
61
- break;
62
- case "response":
63
- this.responseSuccess = fn;
64
- break;
65
- case "error":
66
- this.error = fn;
67
- break;
68
- }
69
- return this;
70
- };
71
- Object.defineProperty(Interceptors.prototype, "reqFn", {
72
- get: function () {
73
- return this.requestSuccess;
74
- },
75
- enumerable: false,
76
- configurable: true
77
- });
78
- Object.defineProperty(Interceptors.prototype, "resFn", {
79
- get: function () {
80
- return this.responseSuccess;
81
- },
82
- enumerable: false,
83
- configurable: true
84
- });
85
- Object.defineProperty(Interceptors.prototype, "errFn", {
86
- get: function () {
87
- return this.error;
88
- },
89
- enumerable: false,
90
- configurable: true
91
- });
92
- return Interceptors;
93
- }();
94
- var RequestBase = function (_super) {
95
- __extends(RequestBase, _super);
96
- function RequestBase(origin) {
97
- var _this = _super.call(this) || this;
98
- _this.chackUrl = function (url) {
99
- return url.startsWith('/');
100
- };
101
- _this.checkIsHttps = function (url) {
102
- return url.startsWith('https');
103
- };
104
- _this.fixOrigin = function (fixStr) {
105
- if (_this.chackUrl(fixStr)) return _this.origin + fixStr;
106
- return fixStr;
107
- };
108
- _this.envDesc = function () {
109
- if (typeof Window !== "undefined") {
110
- return "Window";
111
- }
112
- return "Node";
113
- };
114
- _this.errorFn = function (reject) {
115
- return function (err) {
116
- var _a, _b;return reject((_b = (_a = _this.errFn) === null || _a === void 0 ? void 0 : _a.call(_this, err)) !== null && _b !== void 0 ? _b : err);
117
- };
118
- };
119
- _this.clearTimer = function (opts) {
120
- return !!opts.timer && (clearTimeout(opts.timer), opts.timer = null);
121
- };
122
- _this.initAbort = function (params) {
123
- var controller = params.controller,
124
- timer = params.timer,
125
- timeout = params.timeout;
126
- !!!timer && (params.timer = setTimeout(function () {
127
- return controller.abort();
128
- }, timeout));
129
- return params;
130
- };
131
- _this.requestType = function () {
132
- switch (_this.envDesc()) {
133
- case "Window":
134
- return _this.fetch;
135
- case "Node":
136
- return _this.http;
137
- }
138
- };
139
- _this.getDataByType = function (type, response) {
140
- switch (type) {
141
- case "text":
142
- case "json":
143
- case "blob":
144
- case "formData":
145
- case "arrayBuffer":
146
- return response[type]();
147
- default:
148
- return response['json']();
149
- }
150
- };
151
- _this.formatBodyString = function (bodyString) {
152
- return {
153
- text: function () {
154
- return bodyString;
155
- },
156
- json: function () {
157
- var _a;return (_a = (0, index_js_1.stringToJson)(bodyString)) !== null && _a !== void 0 ? _a : bodyString;
158
- },
159
- blob: function () {
160
- return (0, index_js_1.stringToJson)(bodyString);
161
- },
162
- formData: function () {
163
- return (0, index_js_1.stringToJson)(bodyString);
164
- },
165
- arrayBuffer: function () {
166
- return (0, index_js_1.stringToJson)(bodyString);
167
- }
168
- };
169
- };
170
- _this.origin = origin !== null && origin !== void 0 ? origin : '';
171
- return _this;
172
- }
173
- return RequestBase;
174
- }(Interceptors);
175
- var RequestInit = function (_super) {
176
- __extends(RequestInit, _super);
177
- function RequestInit(origin) {
178
- var _this = _super.call(this, origin) || this;
179
- _this.initDefaultParams = function (url, _a) {
180
- var _b, _c;
181
- var _d = _a.method,
182
- method = _d === void 0 ? "GET" : _d,
183
- _e = _a.query,
184
- query = _e === void 0 ? {} : _e,
185
- _f = _a.headers,
186
- headers = _f === void 0 ? {} : _f,
187
- _g = _a.body,
188
- body = _g === void 0 ? null : _g,
189
- _h = _a.timeout,
190
- timeout = _h === void 0 ? 30 * 1000 : _h,
191
- _j = _a.controller,
192
- controller = _j === void 0 ? new CustomAbortController() : _j,
193
- _k = _a.type,
194
- type = _k === void 0 ? "json" : _k,
195
- others = __rest(_a, ["method", "query", "headers", "body", "timeout", "controller", "type"]);
196
- var __params = __assign({ url: url, method: method, query: query, headers: headers, body: method === "GET" ? null : (0, index_js_1.jsonToString)(body), timeout: timeout, signal: controller === null || controller === void 0 ? void 0 : controller.signal, controller: controller, type: type, timer: null }, others);
197
- var params = (_c = (_b = _this.reqFn) === null || _b === void 0 ? void 0 : _b.call(_this, __params)) !== null && _c !== void 0 ? _c : __params;
198
- params.url = (0, index_js_1.urlJoin)(_this.fixOrigin(url), __params.query);
199
- return params;
200
- };
201
- _this.initFetchParams = function (url, opts) {
202
- var _temp = _this.initAbort(_this.initDefaultParams(url, opts));
203
- return _temp;
204
- };
205
- _this.initHttpParams = function (url, opts) {
206
- var _temp = _this.initAbort(_this.initDefaultParams(url, opts));
207
- var options = parse(_temp.url, true);
208
- return __assign(__assign({}, _temp), options);
209
- };
210
- return _this;
211
- }
212
- return RequestInit;
213
- }(RequestBase);
214
- var Request = function (_super) {
215
- __extends(Request, _super);
216
- function Request(origin) {
217
- var _this = _super.call(this, origin) || this;
218
- _this.fetch = function (_url, _opts) {
219
- var _a = (0, index_js_1.defer)(),
220
- promise = _a.promise,
221
- resolve = _a.resolve,
222
- reject = _a.reject;
223
- var _b = _this.initFetchParams(_url, _opts),
224
- url = _b.url,
225
- opts = __rest(_b, ["url"]);
226
- var signal = opts.signal;
227
- promise.finally(function () {
228
- return _this.clearTimer(opts);
229
- });
230
- signal.addEventListener('abort', function () {
231
- return _this.errorFn(reject);
232
- });
233
- fetch(url, opts).then(function (response) {
234
- if ((response === null || response === void 0 ? void 0 : response.status) >= 200 && (response === null || response === void 0 ? void 0 : response.status) < 300) {
235
- return _this.getDataByType(opts.type, response);
236
- }
237
- return _this.errorFn(reject);
238
- }).then(function (res) {
239
- var _a, _b;return resolve((_b = (_a = _this.resFn) === null || _a === void 0 ? void 0 : _a.call(_this, res)) !== null && _b !== void 0 ? _b : res);
240
- }).catch(_this.errorFn(reject));
241
- return promise;
242
- };
243
- _this.http = function (_url, _opts) {
244
- var _a = (0, index_js_1.defer)(),
245
- promise = _a.promise,
246
- resolve = _a.resolve,
247
- reject = _a.reject;
248
- var params = _this.initHttpParams(_url, _opts);
249
- var signal = params.signal,
250
- url = params.url;
251
- promise.finally(function () {
252
- return _this.clearTimer(params);
253
- });
254
- var request = _this.checkIsHttps(url) ? httpsRequest : httpRequest;
255
- var req = request(params, function (response) {
256
- if ((response === null || response === void 0 ? void 0 : response.statusCode) >= 200 && (response === null || response === void 0 ? void 0 : response.statusCode) < 300) {
257
- var data_1 = "";
258
- response.setEncoding('utf8');
259
- response.on('data', function (chunk) {
260
- return data_1 += chunk;
261
- });
262
- return response.on("end", function () {
263
- var _a, _b;
264
- var result = _this.getDataByType(params.type, _this.formatBodyString(data_1));
265
- resolve((_b = (_a = _this.resFn) === null || _a === void 0 ? void 0 : _a.call(_this, result)) !== null && _b !== void 0 ? _b : result);
266
- });
267
- }
268
- return _this.errorFn(reject)(response === null || response === void 0 ? void 0 : response.statusMessage);
269
- });
270
- signal.addEventListener('abort', function () {
271
- return _this.errorFn(reject)(req.destroy(new Error('request timeout')));
272
- });
273
- req.on('error', _this.errorFn(reject));
274
- req.end();
275
- return promise;
276
- };
277
- _this.GET = function (url, query, _, opts) {
278
- return _this.request(url, __assign({ query: query, method: "GET" }, opts));
279
- };
280
- _this.POST = function (url, query, body, opts) {
281
- return _this.request(url, __assign({ query: query, method: "POST", body: body }, opts));
282
- };
283
- _this.PUT = function (url, query, body, opts) {
284
- return _this.request(url, __assign({ query: query, method: "PUT", body: body }, opts));
285
- };
286
- _this.DELETE = function (url, query, body, opts) {
287
- return _this.request(url, __assign({ query: query, method: "DELETE", body: body }, opts));
288
- };
289
- _this.OPTIONS = function (url, query, body, opts) {
290
- return _this.request(url, __assign({ query: query, method: "OPTIONS", body: body }, opts));
291
- };
292
- _this.HEAD = function (url, query, body, opts) {
293
- return _this.request(url, __assign({ query: query, method: "HEAD", body: body }, opts));
294
- };
295
- _this.PATCH = function (url, query, body, opts) {
296
- return _this.request(url, __assign({ query: query, method: "PATCH", body: body }, opts));
297
- };
298
- _this.request = _this.requestType();
299
- return _this;
300
- }
301
- return Request;
302
- }(RequestInit);
303
- exports.Request = Request;
304
- exports.default = { Request: Request };
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __assign = (this && this.__assign) || function () {
18
+ __assign = Object.assign || function(t) {
19
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
20
+ s = arguments[i];
21
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
22
+ t[p] = s[p];
23
+ }
24
+ return t;
25
+ };
26
+ return __assign.apply(this, arguments);
27
+ };
28
+ var __rest = (this && this.__rest) || function (s, e) {
29
+ var t = {};
30
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
31
+ t[p] = s[p];
32
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
33
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
34
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
35
+ t[p[i]] = s[p[i]];
36
+ }
37
+ return t;
38
+ };
39
+ Object.defineProperty(exports, "__esModule", { value: true });
40
+ exports.Request = void 0;
41
+ var index_js_1 = require("./index.js");
42
+ var httpRequest, httpsRequest, parse, CustomAbortController;
43
+ if (typeof require !== "undefined") {
44
+ CustomAbortController = require("abort-controller");
45
+ httpRequest = require("http").request;
46
+ httpsRequest = require("https").request;
47
+ parse = require("url").parse;
48
+ }
49
+ else if (typeof AbortController !== "undefined") {
50
+ CustomAbortController = AbortController;
51
+ }
52
+ else {
53
+ CustomAbortController = function () {
54
+ throw new Error('AbortController is not defined');
55
+ };
56
+ }
57
+ var Interceptors = (function () {
58
+ function Interceptors() {
59
+ }
60
+ Interceptors.prototype.use = function (type, fn) {
61
+ switch (type) {
62
+ case "request":
63
+ this.requestSuccess = fn;
64
+ break;
65
+ case "response":
66
+ this.responseSuccess = fn;
67
+ break;
68
+ case "error":
69
+ this.error = fn;
70
+ break;
71
+ }
72
+ return this;
73
+ };
74
+ Object.defineProperty(Interceptors.prototype, "reqFn", {
75
+ get: function () {
76
+ return this.requestSuccess;
77
+ },
78
+ enumerable: false,
79
+ configurable: true
80
+ });
81
+ Object.defineProperty(Interceptors.prototype, "resFn", {
82
+ get: function () {
83
+ return this.responseSuccess;
84
+ },
85
+ enumerable: false,
86
+ configurable: true
87
+ });
88
+ Object.defineProperty(Interceptors.prototype, "errFn", {
89
+ get: function () {
90
+ return this.error;
91
+ },
92
+ enumerable: false,
93
+ configurable: true
94
+ });
95
+ return Interceptors;
96
+ }());
97
+ var RequestBase = (function (_super) {
98
+ __extends(RequestBase, _super);
99
+ function RequestBase(origin) {
100
+ var _this = _super.call(this) || this;
101
+ _this.chackUrl = function (url) {
102
+ return url.startsWith('/');
103
+ };
104
+ _this.checkIsHttps = function (url) {
105
+ return url.startsWith('https');
106
+ };
107
+ _this.fixOrigin = function (fixStr) {
108
+ if (_this.chackUrl(fixStr))
109
+ return _this.origin + fixStr;
110
+ return fixStr;
111
+ };
112
+ _this.envDesc = function () {
113
+ if (typeof Window !== "undefined") {
114
+ return "Window";
115
+ }
116
+ return "Node";
117
+ };
118
+ _this.errorFn = function (reject) { return function (err) { var _a, _b; return reject((_b = (_a = _this.errFn) === null || _a === void 0 ? void 0 : _a.call(_this, err)) !== null && _b !== void 0 ? _b : err); }; };
119
+ _this.clearTimer = function (opts) { return !!opts.timer && (clearTimeout(opts.timer), opts.timer = null); };
120
+ _this.initAbort = function (params) {
121
+ var controller = params.controller, timer = params.timer, timeout = params.timeout;
122
+ !!!timer && (params.timer = setTimeout(function () { return controller.abort(); }, timeout));
123
+ return params;
124
+ };
125
+ _this.requestType = function () {
126
+ switch (_this.envDesc()) {
127
+ case "Window":
128
+ return _this.fetch;
129
+ case "Node":
130
+ return _this.http;
131
+ }
132
+ };
133
+ _this.getDataByType = function (type, response) {
134
+ switch (type) {
135
+ case "text":
136
+ case "json":
137
+ case "blob":
138
+ case "formData":
139
+ case "arrayBuffer":
140
+ return response[type]();
141
+ default:
142
+ return response['json']();
143
+ }
144
+ };
145
+ _this.formatBodyString = function (bodyString) {
146
+ return {
147
+ text: function () { return bodyString; },
148
+ json: function () { var _a; return (_a = (0, index_js_1.stringToJson)(bodyString)) !== null && _a !== void 0 ? _a : bodyString; },
149
+ blob: function () { return (0, index_js_1.stringToJson)(bodyString); },
150
+ formData: function () { return (0, index_js_1.stringToJson)(bodyString); },
151
+ arrayBuffer: function () { return (0, index_js_1.stringToJson)(bodyString); },
152
+ };
153
+ };
154
+ _this.origin = origin !== null && origin !== void 0 ? origin : '';
155
+ return _this;
156
+ }
157
+ return RequestBase;
158
+ }(Interceptors));
159
+ var RequestInit = (function (_super) {
160
+ __extends(RequestInit, _super);
161
+ function RequestInit(origin) {
162
+ var _this = _super.call(this, origin) || this;
163
+ _this.initDefaultParams = function (url, _a) {
164
+ var _b, _c;
165
+ var _d = _a.method, method = _d === void 0 ? "GET" : _d, _e = _a.query, query = _e === void 0 ? {} : _e, _f = _a.headers, headers = _f === void 0 ? {} : _f, _g = _a.body, body = _g === void 0 ? null : _g, _h = _a.timeout, timeout = _h === void 0 ? 30 * 1000 : _h, _j = _a.controller, controller = _j === void 0 ? new CustomAbortController() : _j, _k = _a.type, type = _k === void 0 ? "json" : _k, others = __rest(_a, ["method", "query", "headers", "body", "timeout", "controller", "type"]);
166
+ var __params = __assign({ url: url, method: method, query: query, headers: headers, body: method === "GET" ? null : (0, index_js_1.jsonToString)(body), timeout: timeout, signal: controller === null || controller === void 0 ? void 0 : controller.signal, controller: controller, type: type, timer: null }, others);
167
+ var params = (_c = (_b = _this.reqFn) === null || _b === void 0 ? void 0 : _b.call(_this, __params)) !== null && _c !== void 0 ? _c : __params;
168
+ params.url = (0, index_js_1.urlJoin)(_this.fixOrigin(url), __params.query);
169
+ return params;
170
+ };
171
+ _this.initFetchParams = function (url, opts) {
172
+ var _temp = _this.initAbort(_this.initDefaultParams(url, opts));
173
+ return _temp;
174
+ };
175
+ _this.initHttpParams = function (url, opts) {
176
+ var _temp = _this.initAbort(_this.initDefaultParams(url, opts));
177
+ var options = parse(_temp.url, true);
178
+ return __assign(__assign({}, _temp), options);
179
+ };
180
+ return _this;
181
+ }
182
+ return RequestInit;
183
+ }(RequestBase));
184
+ var Request = (function (_super) {
185
+ __extends(Request, _super);
186
+ function Request(origin) {
187
+ var _this = _super.call(this, origin) || this;
188
+ _this.fetch = function (_url, _opts) {
189
+ var _a = (0, index_js_1.defer)(), promise = _a.promise, resolve = _a.resolve, reject = _a.reject;
190
+ var _b = _this.initFetchParams(_url, _opts), url = _b.url, opts = __rest(_b, ["url"]);
191
+ var signal = opts.signal;
192
+ promise.finally(function () { return _this.clearTimer(opts); });
193
+ signal.addEventListener('abort', function () { return _this.errorFn(reject); });
194
+ fetch(url, opts).then(function (response) {
195
+ if ((response === null || response === void 0 ? void 0 : response.status) >= 200 && (response === null || response === void 0 ? void 0 : response.status) < 300) {
196
+ return _this.getDataByType(opts.type, response);
197
+ }
198
+ return _this.errorFn(reject);
199
+ }).then(function (res) { var _a, _b; return resolve((_b = (_a = _this.resFn) === null || _a === void 0 ? void 0 : _a.call(_this, res)) !== null && _b !== void 0 ? _b : res); }).catch(_this.errorFn(reject));
200
+ return promise;
201
+ };
202
+ _this.http = function (_url, _opts) {
203
+ var _a = (0, index_js_1.defer)(), promise = _a.promise, resolve = _a.resolve, reject = _a.reject;
204
+ var params = _this.initHttpParams(_url, _opts);
205
+ var signal = params.signal, url = params.url;
206
+ promise.finally(function () { return _this.clearTimer(params); });
207
+ var request = _this.checkIsHttps(url) ? httpsRequest : httpRequest;
208
+ var req = request(params, function (response) {
209
+ if ((response === null || response === void 0 ? void 0 : response.statusCode) >= 200 && (response === null || response === void 0 ? void 0 : response.statusCode) < 300) {
210
+ var data_1 = "";
211
+ response.setEncoding('utf8');
212
+ response.on('data', function (chunk) { return data_1 += chunk; });
213
+ return response.on("end", function () {
214
+ var _a, _b;
215
+ var result = _this.getDataByType(params.type, _this.formatBodyString(data_1));
216
+ resolve((_b = (_a = _this.resFn) === null || _a === void 0 ? void 0 : _a.call(_this, result)) !== null && _b !== void 0 ? _b : result);
217
+ });
218
+ }
219
+ return _this.errorFn(reject)(response === null || response === void 0 ? void 0 : response.statusMessage);
220
+ });
221
+ signal.addEventListener('abort', function () { return _this.errorFn(reject)(req.destroy(new Error('request timeout'))); });
222
+ req.on('error', _this.errorFn(reject));
223
+ req.end();
224
+ return promise;
225
+ };
226
+ _this.GET = function (url, query, _, opts) { return _this.request(url, __assign({ query: query, method: "GET" }, opts)); };
227
+ _this.POST = function (url, query, body, opts) { return _this.request(url, __assign({ query: query, method: "POST", body: body }, opts)); };
228
+ _this.PUT = function (url, query, body, opts) { return _this.request(url, __assign({ query: query, method: "PUT", body: body }, opts)); };
229
+ _this.DELETE = function (url, query, body, opts) { return _this.request(url, __assign({ query: query, method: "DELETE", body: body }, opts)); };
230
+ _this.OPTIONS = function (url, query, body, opts) { return _this.request(url, __assign({ query: query, method: "OPTIONS", body: body }, opts)); };
231
+ _this.HEAD = function (url, query, body, opts) { return _this.request(url, __assign({ query: query, method: "HEAD", body: body }, opts)); };
232
+ _this.PATCH = function (url, query, body, opts) { return _this.request(url, __assign({ query: query, method: "PATCH", body: body }, opts)); };
233
+ _this.request = _this.requestType();
234
+ return _this;
235
+ }
236
+ return Request;
237
+ }(RequestInit));
238
+ exports.Request = Request;
239
+ exports.default = { Request: Request };
@@ -1,19 +1,18 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.types = void 0;
5
- var types;
6
- (function (types) {
7
- types["[object Array]"] = "array";
8
- types["[object Object]"] = "object";
9
- types["[object Function]"] = "function";
10
- types["[object Set]"] = "set";
11
- types["[object Map]"] = "map";
12
- types["[object WeakMap]"] = "weakMap";
13
- types["[object WeakSet]"] = "weakSet";
14
- types["[object Date]"] = "date";
15
- types["[object RegExp]"] = "regExp";
16
- types["[object Math]"] = "math";
17
- })(types = exports.types || (exports.types = {}));
18
- ;
19
- exports.default = { types: types };
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.types = void 0;
4
+ var types;
5
+ (function (types) {
6
+ types["[object Array]"] = "array";
7
+ types["[object Object]"] = "object";
8
+ types["[object Function]"] = "function";
9
+ types["[object Set]"] = "set";
10
+ types["[object Map]"] = "map";
11
+ types["[object WeakMap]"] = "weakMap";
12
+ types["[object WeakSet]"] = "weakSet";
13
+ types["[object Date]"] = "date";
14
+ types["[object RegExp]"] = "regExp";
15
+ types["[object Math]"] = "math";
16
+ })(types = exports.types || (exports.types = {}));
17
+ ;
18
+ exports.default = { types: types };