@nestjs/common 10.4.16 → 10.4.18
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs/common",
|
|
3
|
-
"version": "10.4.
|
|
3
|
+
"version": "10.4.18",
|
|
4
4
|
"description": "Nest - modern, fast, powerful node.js web framework (@common)",
|
|
5
5
|
"author": "Kamil Mysliwiec",
|
|
6
6
|
"homepage": "https://nestjs.com",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
|
+
"file-type": "20.4.1",
|
|
21
22
|
"iterare": "1.2.1",
|
|
22
23
|
"tslib": "2.8.1",
|
|
23
24
|
"uid": "2.0.2"
|
|
@@ -25,7 +26,6 @@
|
|
|
25
26
|
"peerDependencies": {
|
|
26
27
|
"class-transformer": "*",
|
|
27
28
|
"class-validator": "*",
|
|
28
|
-
"file-type": "^20.4.1",
|
|
29
29
|
"reflect-metadata": "^0.1.12 || ^0.2.0",
|
|
30
30
|
"rxjs": "^7.1.0"
|
|
31
31
|
},
|
|
@@ -35,9 +35,6 @@
|
|
|
35
35
|
},
|
|
36
36
|
"class-transformer": {
|
|
37
37
|
"optional": true
|
|
38
|
-
},
|
|
39
|
-
"file-type": {
|
|
40
|
-
"optional": true
|
|
41
38
|
}
|
|
42
39
|
}
|
|
43
40
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.filterLogLevels = filterLogLevels;
|
|
4
|
+
const logger_service_1 = require("../logger.service");
|
|
5
|
+
const is_log_level_util_1 = require("./is-log-level.util");
|
|
6
|
+
/**
|
|
7
|
+
* @publicApi
|
|
8
|
+
*/
|
|
9
|
+
function filterLogLevels(parseableString = '') {
|
|
10
|
+
const sanitizedSring = parseableString.replaceAll(' ', '').toLowerCase();
|
|
11
|
+
if (sanitizedSring[0] === '>') {
|
|
12
|
+
const orEqual = sanitizedSring[1] === '=';
|
|
13
|
+
const logLevelIndex = logger_service_1.LOG_LEVELS.indexOf(sanitizedSring.substring(orEqual ? 2 : 1));
|
|
14
|
+
if (logLevelIndex === -1) {
|
|
15
|
+
throw new Error(`parse error (unknown log level): ${sanitizedSring}`);
|
|
16
|
+
}
|
|
17
|
+
return logger_service_1.LOG_LEVELS.slice(orEqual ? logLevelIndex : logLevelIndex + 1);
|
|
18
|
+
}
|
|
19
|
+
else if (sanitizedSring.includes(',')) {
|
|
20
|
+
return sanitizedSring.split(',').filter(is_log_level_util_1.isLogLevel);
|
|
21
|
+
}
|
|
22
|
+
return (0, is_log_level_util_1.isLogLevel)(sanitizedSring) ? [sanitizedSring] : logger_service_1.LOG_LEVELS;
|
|
23
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isLogLevel = isLogLevel;
|
|
4
|
+
const logger_service_1 = require("../logger.service");
|
|
5
|
+
/**
|
|
6
|
+
* @publicApi
|
|
7
|
+
*/
|
|
8
|
+
function isLogLevel(maybeLogLevel) {
|
|
9
|
+
return logger_service_1.LOG_LEVELS.includes(maybeLogLevel);
|
|
10
|
+
}
|