@nestjs/common 9.3.10 → 9.3.12

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": "9.3.10",
3
+ "version": "9.3.12",
4
4
  "description": "Nest - modern, fast, powerful node.js web framework (@common)",
5
5
  "author": "Kamil Mysliwiec",
6
6
  "homepage": "https://nestjs.com",
@@ -67,7 +67,7 @@ export declare class ConsoleLogger implements LoggerService {
67
67
  protected formatPid(pid: number): string;
68
68
  protected formatContext(context: string): string;
69
69
  protected formatMessage(logLevel: LogLevel, message: unknown, pidMessage: string, formattedLogLevel: string, contextMessage: string, timestampDiff: string): string;
70
- protected stringifyMessage(message: unknown, logLevel: LogLevel): string;
70
+ protected stringifyMessage(message: unknown, logLevel: LogLevel): any;
71
71
  protected colorize(message: string, logLevel: LogLevel): string;
72
72
  protected printStackTrace(stack: string): void;
73
73
  private updateAndGetTimestampDiff;
@@ -135,9 +135,12 @@ let ConsoleLogger = ConsoleLogger_1 = class ConsoleLogger {
135
135
  return `${pidMessage}${this.getTimestamp()} ${formattedLogLevel} ${contextMessage}${output}${timestampDiff}\n`;
136
136
  }
137
137
  stringifyMessage(message, logLevel) {
138
- return (0, shared_utils_1.isPlainObject)(message) || Array.isArray(message)
139
- ? `${this.colorize('Object:', logLevel)}\n${JSON.stringify(message, (key, value) => typeof value === 'bigint' ? value.toString() : value, 2)}\n`
140
- : this.colorize(message, logLevel);
138
+ // If the message is a function, call it and re-resolve its value.
139
+ return (0, shared_utils_1.isFunction)(message)
140
+ ? this.stringifyMessage(message(), logLevel)
141
+ : (0, shared_utils_1.isPlainObject)(message) || Array.isArray(message)
142
+ ? `${this.colorize('Object:', logLevel)}\n${JSON.stringify(message, (key, value) => typeof value === 'bigint' ? value.toString() : value, 2)}\n`
143
+ : this.colorize(message, logLevel);
141
144
  }
142
145
  colorize(message, logLevel) {
143
146
  const color = this.getColorByLogLevel(logLevel);
@@ -4,7 +4,7 @@ export declare const isPlainObject: (fn: any) => fn is object;
4
4
  export declare const addLeadingSlash: (path?: string) => string;
5
5
  export declare const normalizePath: (path?: string) => string;
6
6
  export declare const stripEndSlash: (path: string) => string;
7
- export declare const isFunction: (val: any) => boolean;
7
+ export declare const isFunction: (val: any) => val is Function;
8
8
  export declare const isString: (val: any) => val is string;
9
9
  export declare const isNumber: (val: any) => val is number;
10
10
  export declare const isConstructor: (val: any) => boolean;