utils-lib-js 1.2.1 → 1.3.1
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.
- package/dist/common/request.js +7 -4
- package/dist/esm/request.js +5 -2
- package/package.json +1 -1
- package/pnpm-lock.yaml +37 -4
package/dist/common/request.js
CHANGED
|
@@ -39,8 +39,11 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
40
|
exports.Request = void 0;
|
|
41
41
|
var index_js_1 = require("./index.js");
|
|
42
|
-
var
|
|
43
|
-
|
|
42
|
+
var request, parse;
|
|
43
|
+
if (typeof require !== "undefined") {
|
|
44
|
+
request = require("http").request;
|
|
45
|
+
parse = require("url").parse;
|
|
46
|
+
}
|
|
44
47
|
var Interceptors = function () {
|
|
45
48
|
function Interceptors() {}
|
|
46
49
|
Interceptors.prototype.use = function (type, fn) {
|
|
@@ -188,7 +191,7 @@ var RequestInit = function (_super) {
|
|
|
188
191
|
_this.initHttpParams = function (url, opts) {
|
|
189
192
|
var _a, _b;
|
|
190
193
|
var params = _this.initAbort(_this.initDefaultParams(url, opts));
|
|
191
|
-
var options =
|
|
194
|
+
var options = parse(params.url, true);
|
|
192
195
|
return (_b = (_a = _this.reqFn) === null || _a === void 0 ? void 0 : _a.call(_this, __assign(__assign({}, params), options))) !== null && _b !== void 0 ? _b : __assign(__assign({}, params), options);
|
|
193
196
|
};
|
|
194
197
|
return _this;
|
|
@@ -234,7 +237,7 @@ var Request = function (_super) {
|
|
|
234
237
|
promise.finally(function () {
|
|
235
238
|
return _this.clearTimer(params);
|
|
236
239
|
});
|
|
237
|
-
var req =
|
|
240
|
+
var req = request(params, function (response) {
|
|
238
241
|
if ((response === null || response === void 0 ? void 0 : response.statusCode) >= 200 && (response === null || response === void 0 ? void 0 : response.statusCode) < 300) {
|
|
239
242
|
var data_1 = "";
|
|
240
243
|
response.setEncoding('utf8');
|
package/dist/esm/request.js
CHANGED
|
@@ -35,8 +35,11 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
35
35
|
return t;
|
|
36
36
|
};
|
|
37
37
|
import { urlJoin, defer, jsonToString, stringToJson } from "./index.js";
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
var request, parse;
|
|
39
|
+
if (typeof require !== "undefined") {
|
|
40
|
+
request = require("http").request;
|
|
41
|
+
parse = require("url").parse;
|
|
42
|
+
}
|
|
40
43
|
var Interceptors = function () {
|
|
41
44
|
function Interceptors() {}
|
|
42
45
|
Interceptors.prototype.use = function (type, fn) {
|
package/package.json
CHANGED
package/pnpm-lock.yaml
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
lockfileVersion: 5.
|
|
1
|
+
lockfileVersion: 5.3
|
|
2
2
|
|
|
3
3
|
specifiers:
|
|
4
4
|
'@types/node': ^18.7.15
|
|
5
5
|
babel-cli: ^6.26.0
|
|
6
6
|
|
|
7
7
|
devDependencies:
|
|
8
|
-
'@types/node': 18.
|
|
8
|
+
'@types/node': 18.11.9
|
|
9
9
|
babel-cli: 6.26.0
|
|
10
10
|
|
|
11
11
|
packages:
|
|
12
12
|
|
|
13
|
-
/@types/node/18.
|
|
14
|
-
resolution: {integrity: sha512-
|
|
13
|
+
/@types/node/18.11.9:
|
|
14
|
+
resolution: {integrity: sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==}
|
|
15
15
|
dev: true
|
|
16
16
|
|
|
17
17
|
/ansi-regex/2.1.1:
|
|
@@ -108,6 +108,8 @@ packages:
|
|
|
108
108
|
v8flags: 2.1.1
|
|
109
109
|
optionalDependencies:
|
|
110
110
|
chokidar: 1.7.0
|
|
111
|
+
transitivePeerDependencies:
|
|
112
|
+
- supports-color
|
|
111
113
|
dev: true
|
|
112
114
|
|
|
113
115
|
/babel-code-frame/6.26.0:
|
|
@@ -140,6 +142,8 @@ packages:
|
|
|
140
142
|
private: 0.1.8
|
|
141
143
|
slash: 1.0.0
|
|
142
144
|
source-map: 0.5.7
|
|
145
|
+
transitivePeerDependencies:
|
|
146
|
+
- supports-color
|
|
143
147
|
dev: true
|
|
144
148
|
|
|
145
149
|
/babel-generator/6.26.1:
|
|
@@ -160,6 +164,8 @@ packages:
|
|
|
160
164
|
dependencies:
|
|
161
165
|
babel-runtime: 6.26.0
|
|
162
166
|
babel-template: 6.26.0
|
|
167
|
+
transitivePeerDependencies:
|
|
168
|
+
- supports-color
|
|
163
169
|
dev: true
|
|
164
170
|
|
|
165
171
|
/babel-messages/6.23.0:
|
|
@@ -186,6 +192,8 @@ packages:
|
|
|
186
192
|
lodash: 4.17.21
|
|
187
193
|
mkdirp: 0.5.6
|
|
188
194
|
source-map-support: 0.4.18
|
|
195
|
+
transitivePeerDependencies:
|
|
196
|
+
- supports-color
|
|
189
197
|
dev: true
|
|
190
198
|
|
|
191
199
|
/babel-runtime/6.26.0:
|
|
@@ -203,6 +211,8 @@ packages:
|
|
|
203
211
|
babel-types: 6.26.0
|
|
204
212
|
babylon: 6.18.0
|
|
205
213
|
lodash: 4.17.21
|
|
214
|
+
transitivePeerDependencies:
|
|
215
|
+
- supports-color
|
|
206
216
|
dev: true
|
|
207
217
|
|
|
208
218
|
/babel-traverse/6.26.0:
|
|
@@ -217,6 +227,8 @@ packages:
|
|
|
217
227
|
globals: 9.18.0
|
|
218
228
|
invariant: 2.2.4
|
|
219
229
|
lodash: 4.17.21
|
|
230
|
+
transitivePeerDependencies:
|
|
231
|
+
- supports-color
|
|
220
232
|
dev: true
|
|
221
233
|
|
|
222
234
|
/babel-types/6.26.0:
|
|
@@ -296,6 +308,8 @@ packages:
|
|
|
296
308
|
snapdragon-node: 2.1.1
|
|
297
309
|
split-string: 3.1.0
|
|
298
310
|
to-regex: 3.0.2
|
|
311
|
+
transitivePeerDependencies:
|
|
312
|
+
- supports-color
|
|
299
313
|
dev: true
|
|
300
314
|
optional: true
|
|
301
315
|
|
|
@@ -341,6 +355,8 @@ packages:
|
|
|
341
355
|
readdirp: 2.2.1
|
|
342
356
|
optionalDependencies:
|
|
343
357
|
fsevents: 1.2.13
|
|
358
|
+
transitivePeerDependencies:
|
|
359
|
+
- supports-color
|
|
344
360
|
dev: true
|
|
345
361
|
optional: true
|
|
346
362
|
|
|
@@ -402,6 +418,11 @@ packages:
|
|
|
402
418
|
|
|
403
419
|
/debug/2.6.9:
|
|
404
420
|
resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==}
|
|
421
|
+
peerDependencies:
|
|
422
|
+
supports-color: '*'
|
|
423
|
+
peerDependenciesMeta:
|
|
424
|
+
supports-color:
|
|
425
|
+
optional: true
|
|
405
426
|
dependencies:
|
|
406
427
|
ms: 2.0.0
|
|
407
428
|
dev: true
|
|
@@ -473,6 +494,8 @@ packages:
|
|
|
473
494
|
regex-not: 1.0.2
|
|
474
495
|
snapdragon: 0.8.2
|
|
475
496
|
to-regex: 3.0.2
|
|
497
|
+
transitivePeerDependencies:
|
|
498
|
+
- supports-color
|
|
476
499
|
dev: true
|
|
477
500
|
optional: true
|
|
478
501
|
|
|
@@ -521,6 +544,8 @@ packages:
|
|
|
521
544
|
regex-not: 1.0.2
|
|
522
545
|
snapdragon: 0.8.2
|
|
523
546
|
to-regex: 3.0.2
|
|
547
|
+
transitivePeerDependencies:
|
|
548
|
+
- supports-color
|
|
524
549
|
dev: true
|
|
525
550
|
optional: true
|
|
526
551
|
|
|
@@ -1002,6 +1027,8 @@ packages:
|
|
|
1002
1027
|
regex-not: 1.0.2
|
|
1003
1028
|
snapdragon: 0.8.2
|
|
1004
1029
|
to-regex: 3.0.2
|
|
1030
|
+
transitivePeerDependencies:
|
|
1031
|
+
- supports-color
|
|
1005
1032
|
dev: true
|
|
1006
1033
|
optional: true
|
|
1007
1034
|
|
|
@@ -1056,6 +1083,8 @@ packages:
|
|
|
1056
1083
|
regex-not: 1.0.2
|
|
1057
1084
|
snapdragon: 0.8.2
|
|
1058
1085
|
to-regex: 3.0.2
|
|
1086
|
+
transitivePeerDependencies:
|
|
1087
|
+
- supports-color
|
|
1059
1088
|
dev: true
|
|
1060
1089
|
optional: true
|
|
1061
1090
|
|
|
@@ -1205,6 +1234,8 @@ packages:
|
|
|
1205
1234
|
graceful-fs: 4.2.10
|
|
1206
1235
|
micromatch: 3.1.10
|
|
1207
1236
|
readable-stream: 2.3.7
|
|
1237
|
+
transitivePeerDependencies:
|
|
1238
|
+
- supports-color
|
|
1208
1239
|
dev: true
|
|
1209
1240
|
optional: true
|
|
1210
1241
|
|
|
@@ -1326,6 +1357,8 @@ packages:
|
|
|
1326
1357
|
source-map: 0.5.7
|
|
1327
1358
|
source-map-resolve: 0.5.3
|
|
1328
1359
|
use: 3.1.1
|
|
1360
|
+
transitivePeerDependencies:
|
|
1361
|
+
- supports-color
|
|
1329
1362
|
dev: true
|
|
1330
1363
|
optional: true
|
|
1331
1364
|
|