egg 3.20.0 → 3.22.0
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/lib/core/utils.js +4 -3
- package/lib/egg.js +8 -0
- package/package.json +1 -1
package/lib/core/utils.js
CHANGED
|
@@ -20,18 +20,19 @@ function convertObject(obj, ignore) {
|
|
|
20
20
|
function convertValue(key, value, ignore) {
|
|
21
21
|
if (is.nullOrUndefined(value)) return value;
|
|
22
22
|
|
|
23
|
-
let hit;
|
|
23
|
+
let hit = false;
|
|
24
24
|
for (const matchKey of ignore) {
|
|
25
25
|
if (is.string(matchKey) && matchKey === key) {
|
|
26
26
|
hit = true;
|
|
27
|
+
break;
|
|
27
28
|
} else if (is.regExp(matchKey) && matchKey.test(key)) {
|
|
28
29
|
hit = true;
|
|
30
|
+
break;
|
|
29
31
|
}
|
|
30
32
|
}
|
|
31
33
|
if (!hit) {
|
|
32
34
|
if (is.symbol(value) || is.regExp(value)) return value.toString();
|
|
33
|
-
if (is.primitive(value)) return value;
|
|
34
|
-
if (is.array(value)) return value;
|
|
35
|
+
if (is.primitive(value) || is.array(value)) return value;
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
// only convert recursively when it's a plain object,
|
package/lib/egg.js
CHANGED
|
@@ -304,6 +304,14 @@ class EggApplication extends EggCore {
|
|
|
304
304
|
return this[HTTPCLIENT];
|
|
305
305
|
}
|
|
306
306
|
|
|
307
|
+
/**
|
|
308
|
+
* @alias httpclient
|
|
309
|
+
* @member {HttpClient}
|
|
310
|
+
*/
|
|
311
|
+
get httpClient() {
|
|
312
|
+
return this.httpclient;
|
|
313
|
+
}
|
|
314
|
+
|
|
307
315
|
/**
|
|
308
316
|
* All loggers contain logger, coreLogger and customLogger
|
|
309
317
|
* @member {Object}
|