@nestjs/common 10.4.17 → 10.4.19

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.17",
3
+ "version": "10.4.19",
4
4
  "description": "Nest - modern, fast, powerful node.js web framework (@common)",
5
5
  "author": "Kamil Mysliwiec",
6
6
  "homepage": "https://nestjs.com",
@@ -0,0 +1,5 @@
1
+ import { LogLevel } from '../logger.service';
2
+ /**
3
+ * @publicApi
4
+ */
5
+ export declare function filterLogLevels(parseableString?: string): LogLevel[];
@@ -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,5 @@
1
+ import { LogLevel } from '../logger.service';
2
+ /**
3
+ * @publicApi
4
+ */
5
+ export declare function isLogLevel(maybeLogLevel: any): maybeLogLevel is LogLevel;
@@ -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
+ }