@decaf-ts/logging 0.10.0 → 0.10.2

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.
Files changed (100) hide show
  1. package/README.md +298 -171
  2. package/dist/logging.cjs +1 -1
  3. package/dist/logging.cjs.map +1 -1
  4. package/dist/logging.js +1 -1
  5. package/dist/logging.js.map +1 -1
  6. package/lib/LoggedClass.cjs +4 -4
  7. package/lib/LoggedClass.d.ts +4 -4
  8. package/lib/constants.cjs +32 -63
  9. package/lib/constants.d.ts +32 -63
  10. package/lib/constants.js.map +1 -1
  11. package/lib/decorators.cjs +28 -28
  12. package/lib/decorators.d.ts +29 -36
  13. package/lib/decorators.js.map +1 -1
  14. package/lib/environment.cjs +34 -41
  15. package/lib/environment.d.ts +31 -32
  16. package/lib/environment.js.map +1 -1
  17. package/lib/esm/LoggedClass.d.ts +4 -4
  18. package/lib/esm/LoggedClass.js +4 -4
  19. package/lib/esm/constants.d.ts +32 -63
  20. package/lib/esm/constants.js +32 -63
  21. package/lib/esm/constants.js.map +1 -1
  22. package/lib/esm/decorators.d.ts +29 -36
  23. package/lib/esm/decorators.js +28 -28
  24. package/lib/esm/decorators.js.map +1 -1
  25. package/lib/esm/environment.d.ts +31 -32
  26. package/lib/esm/environment.js +34 -41
  27. package/lib/esm/environment.js.map +1 -1
  28. package/lib/esm/filters/LogFilter.d.ts +11 -11
  29. package/lib/esm/filters/LogFilter.js +5 -5
  30. package/lib/esm/filters/PatternFilter.d.ts +15 -15
  31. package/lib/esm/filters/PatternFilter.js +12 -12
  32. package/lib/esm/index.d.ts +2 -2
  33. package/lib/esm/index.js +3 -3
  34. package/lib/esm/logging.d.ts +119 -113
  35. package/lib/esm/logging.js +223 -138
  36. package/lib/esm/logging.js.map +1 -1
  37. package/lib/esm/pino/index.d.ts +6 -0
  38. package/lib/esm/pino/index.js +6 -0
  39. package/lib/esm/pino/index.js.map +1 -1
  40. package/lib/esm/pino/pino.d.ts +13 -5
  41. package/lib/esm/pino/pino.js +70 -124
  42. package/lib/esm/pino/pino.js.map +1 -1
  43. package/lib/esm/text.d.ts +29 -67
  44. package/lib/esm/text.js +29 -67
  45. package/lib/esm/text.js.map +1 -1
  46. package/lib/esm/time.d.ts +45 -43
  47. package/lib/esm/time.js +38 -36
  48. package/lib/esm/time.js.map +1 -1
  49. package/lib/esm/types.d.ts +59 -50
  50. package/lib/esm/utils.d.ts +43 -0
  51. package/lib/esm/utils.js +55 -3
  52. package/lib/esm/utils.js.map +1 -1
  53. package/lib/esm/web.d.ts +2 -2
  54. package/lib/esm/web.js +2 -2
  55. package/lib/esm/winston/index.d.ts +7 -0
  56. package/lib/esm/winston/index.js +7 -1
  57. package/lib/esm/winston/index.js.map +1 -1
  58. package/lib/esm/winston/winston.d.ts +17 -21
  59. package/lib/esm/winston/winston.js +29 -36
  60. package/lib/esm/winston/winston.js.map +1 -1
  61. package/lib/filters/LogFilter.cjs +5 -5
  62. package/lib/filters/LogFilter.d.ts +11 -11
  63. package/lib/filters/PatternFilter.cjs +12 -12
  64. package/lib/filters/PatternFilter.d.ts +15 -15
  65. package/lib/index.cjs +3 -3
  66. package/lib/index.d.ts +2 -2
  67. package/lib/logging.cjs +224 -139
  68. package/lib/logging.d.ts +119 -113
  69. package/lib/logging.js.map +1 -1
  70. package/lib/pino/index.cjs +6 -0
  71. package/lib/pino/index.d.ts +6 -0
  72. package/lib/pino/index.js.map +1 -1
  73. package/lib/pino/pino.cjs +102 -126
  74. package/lib/pino/pino.d.ts +13 -5
  75. package/lib/pino/pino.js.map +1 -1
  76. package/lib/text.cjs +29 -67
  77. package/lib/text.d.ts +29 -67
  78. package/lib/text.js.map +1 -1
  79. package/lib/time.cjs +38 -36
  80. package/lib/time.d.ts +45 -43
  81. package/lib/time.js.map +1 -1
  82. package/lib/types.d.ts +59 -50
  83. package/lib/utils.cjs +55 -3
  84. package/lib/utils.d.ts +43 -0
  85. package/lib/utils.js.map +1 -1
  86. package/lib/web.cjs +2 -2
  87. package/lib/web.d.ts +2 -2
  88. package/lib/winston/index.cjs +22 -0
  89. package/lib/winston/index.d.ts +7 -0
  90. package/lib/winston/index.js.map +1 -1
  91. package/lib/winston/winston.cjs +29 -36
  92. package/lib/winston/winston.d.ts +17 -21
  93. package/lib/winston/winston.js.map +1 -1
  94. package/package.json +9 -10
  95. package/lib/accumulate.types.cjs +0 -27
  96. package/lib/accumulate.types.d.ts +0 -1
  97. package/lib/accumulate.types.js.map +0 -1
  98. package/lib/esm/accumulate.types.d.ts +0 -1
  99. package/lib/esm/accumulate.types.js +0 -25
  100. package/lib/esm/accumulate.types.js.map +0 -1
@@ -1 +1,7 @@
1
+ /**
2
+ * @module Pino
3
+ * @description This module provides an adapter for the Pino logger.
4
+ * @summary This module exports the {@link PinoLogger} class.
5
+ * @memberOf module:Logging
6
+ */
1
7
  export * from "./pino";
@@ -1,2 +1,8 @@
1
+ /**
2
+ * @module Pino
3
+ * @description This module provides an adapter for the Pino logger.
4
+ * @summary This module exports the {@link PinoLogger} class.
5
+ * @memberOf module:Logging
6
+ */
1
7
  export * from "./pino.js";
2
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/pino/index.ts"],"names":[],"mappings":"AAAA,0BAAuB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/pino/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,0BAAuB"}
@@ -2,11 +2,17 @@ import { Logger as PinoBaseLogger } from "pino";
2
2
  import { MiniLogger } from "../logging";
3
3
  import { Logger, LoggerFactory, LoggingConfig, StringLike } from "../types";
4
4
  import { LogLevel } from "../constants";
5
+ /**
6
+ * @description A logger that is powered by the Pino logging library.
7
+ * @summary This class extends {@link MiniLogger} and uses Pino as its underlying logging engine.
8
+ * @param {string} [context] - The context (typically the class name) that this logger is associated with.
9
+ * @param {Partial<LoggingConfig>} [conf] - Optional configuration to override global settings.
10
+ * @param {PinoBaseLogger} [driver] - An optional, pre-existing Pino logger instance to use.
11
+ * @class PinoLogger
12
+ */
5
13
  export declare class PinoLogger extends MiniLogger implements Logger {
6
14
  protected pino: PinoBaseLogger;
7
- private readonly childLoggers;
8
- constructor(context: string, conf?: Partial<LoggingConfig>);
9
- private activePino;
15
+ constructor(context?: string, conf?: Partial<LoggingConfig>, driver?: PinoBaseLogger);
10
16
  protected log(level: LogLevel, msg: StringLike | Error, error?: Error): void;
11
17
  fatal(msg: StringLike | Error, error?: Error): void;
12
18
  child(bindings?: Record<string, unknown>, options?: Record<string, unknown>): PinoLogger;
@@ -15,7 +21,9 @@ export declare class PinoLogger extends MiniLogger implements Logger {
15
21
  set level(value: string | undefined);
16
22
  }
17
23
  /**
18
- * @description Factory function returning a Pino-backed logger.
19
- * @summary Allows registering the Pino logger with the global Logging facade.
24
+ * @description A factory for creating {@link PinoLogger} instances.
25
+ * @summary This factory function creates a new {@link PinoLogger} instance, and can optionally accept a pre-existing Pino logger instance.
26
+ * @const {LoggerFactory} PinoFactory
27
+ * @memberOf module:Logging
20
28
  */
21
29
  export declare const PinoFactory: LoggerFactory;
@@ -1,6 +1,6 @@
1
- import pino from "pino";
1
+ import pino, { multistream, } from "pino";
2
2
  import { Logging, MiniLogger } from "./../logging.js";
3
- import { LogLevel, NumericLogLevels } from "./../constants.js";
3
+ import { LogLevel } from "./../constants.js";
4
4
  const LogLevelToPino = {
5
5
  [LogLevel.benchmark]: "info",
6
6
  [LogLevel.error]: "error",
@@ -19,106 +19,92 @@ const PinoToLogLevel = {
19
19
  debug: LogLevel.debug,
20
20
  trace: LogLevel.trace,
21
21
  };
22
- const isPinoLogger = (candidate) => {
23
- if (!candidate || typeof candidate !== "object")
24
- return false;
25
- const required = ["info", "error", "warn", "debug", "trace"];
26
- return required.every((method) => typeof candidate[method] === "function");
27
- };
28
22
  const toPinoLevel = (level) => LogLevelToPino[level] ?? "info";
29
23
  const fromPinoLevel = (level) => {
30
24
  if (!level)
31
25
  return undefined;
32
26
  return PinoToLogLevel[level];
33
27
  };
34
- const buildPinoOptions = (context, config, candidate) => {
28
+ const joinContext = (segments, separator) => {
29
+ if (!segments.length)
30
+ return "Logger";
31
+ return segments.join(separator);
32
+ };
33
+ const buildPinoOptions = (context, config, overrides) => {
35
34
  const options = {
36
35
  level: toPinoLevel(config.level),
37
36
  name: context,
38
- ...(candidate || {}),
37
+ ...overrides,
39
38
  };
40
39
  if (!options.level)
41
40
  options.level = toPinoLevel(config.level);
42
41
  if (!options.name)
43
42
  options.name = context;
43
+ options.timestamp = config.timestamp
44
+ ? () => new Date().toISOString()
45
+ : false;
44
46
  return options;
45
47
  };
46
- const mergePinoConfig = (base, overrides) => {
47
- if (!base && !overrides)
48
- return {};
49
- return {
50
- ...(base || {}),
51
- ...(overrides || {}),
52
- options: {
53
- ...(base?.options || {}),
54
- ...(overrides?.options || {}),
55
- },
56
- };
48
+ const isDestinationStream = (candidate) => {
49
+ if (!candidate || typeof candidate !== "object")
50
+ return false;
51
+ return typeof candidate.write === "function";
57
52
  };
58
- const extractPinoConfig = (config) => {
59
- if (!config)
60
- return {};
61
- const raw = config.pino;
62
- if (!raw || typeof raw !== "object")
63
- return {};
64
- return {
65
- instance: raw.instance,
66
- options: raw.options,
67
- destination: raw.destination,
68
- };
53
+ const buildDestination = (transports) => {
54
+ if (!transports || transports.length === 0)
55
+ return undefined;
56
+ const streams = transports.filter(isDestinationStream);
57
+ if (streams.length <= 1)
58
+ return streams[0];
59
+ return multistream(streams.map((stream) => ({ stream })));
69
60
  };
70
- const getPinoConfig = (globalConfig, instanceConfig) => mergePinoConfig(extractPinoConfig(globalConfig), extractPinoConfig(instanceConfig));
61
+ /**
62
+ * @description A logger that is powered by the Pino logging library.
63
+ * @summary This class extends {@link MiniLogger} and uses Pino as its underlying logging engine.
64
+ * @param {string} [context] - The context (typically the class name) that this logger is associated with.
65
+ * @param {Partial<LoggingConfig>} [conf] - Optional configuration to override global settings.
66
+ * @param {PinoBaseLogger} [driver] - An optional, pre-existing Pino logger instance to use.
67
+ * @class PinoLogger
68
+ */
71
69
  export class PinoLogger extends MiniLogger {
72
- constructor(context, conf) {
70
+ constructor(context, conf, driver) {
73
71
  super(context, conf);
74
- this.childLoggers = new Map();
72
+ if (driver) {
73
+ this.pino = driver;
74
+ const derivedLevel = fromPinoLevel(driver.level);
75
+ if (derivedLevel)
76
+ this.setConfig({ level: derivedLevel });
77
+ return;
78
+ }
75
79
  const globalConfig = Logging.getConfig();
76
80
  const config = Object.assign({}, globalConfig, this.conf || {});
77
- const pinoConfig = getPinoConfig(globalConfig, this.conf);
78
- if (isPinoLogger(pinoConfig.instance)) {
79
- this.pino = pinoConfig.instance;
80
- const logLevel = fromPinoLevel(this.pino.level);
81
- if (logLevel)
82
- this.conf = { ...(this.conf || {}), level: logLevel };
83
- }
84
- else {
85
- const options = buildPinoOptions(context, config, pinoConfig.options);
86
- this.pino = pino(options, pinoConfig.destination);
87
- }
88
- }
89
- activePino() {
90
- const override = this.config("pino");
91
- if (override && override.instance && isPinoLogger(override.instance)) {
92
- return override.instance;
93
- }
94
- return this.pino;
81
+ const separator = config.contextSeparator ||
82
+ Logging.getConfig().contextSeparator;
83
+ const contextName = joinContext(Array.isArray(this.context) ? this.context : [], separator);
84
+ const options = buildPinoOptions(contextName, config);
85
+ const destination = buildDestination(config.transports || undefined);
86
+ this.pino = pino(options, destination);
95
87
  }
96
88
  log(level, msg, error) {
97
- const configuredLevel = this.config("level") || LogLevel.info;
98
- if (NumericLogLevels[configuredLevel] < NumericLogLevels[level])
99
- return;
100
89
  const formatted = this.createLog(level, msg, error);
101
90
  const methodName = toPinoLevel(level);
102
- const target = this.activePino();
103
- const emitter = target[methodName];
91
+ const emitter = this.pino[methodName];
104
92
  if (typeof emitter === "function") {
105
- emitter.call(target, formatted);
93
+ emitter.call(this.pino, formatted);
106
94
  return;
107
95
  }
108
- if (typeof target["log"] === "function") {
109
- target.log({
96
+ if (typeof this.pino.log === "function") {
97
+ this.pino.log({
110
98
  level: methodName,
111
99
  msg: formatted,
112
100
  });
113
- return;
114
101
  }
115
102
  }
116
103
  fatal(msg, error) {
117
104
  const formatted = this.createLog(LogLevel.error, msg, error);
118
- const target = this.activePino();
119
- const fatal = target.fatal;
105
+ const fatal = this.pino.fatal;
120
106
  if (typeof fatal === "function") {
121
- fatal.call(target, formatted);
107
+ fatal.call(this.pino, formatted);
122
108
  }
123
109
  else {
124
110
  this.error(msg, error);
@@ -130,81 +116,41 @@ export class PinoLogger extends MiniLogger {
130
116
  : typeof bindings.name === "string"
131
117
  ? bindings.name
132
118
  : undefined;
133
- const combinedContext = nextContext
134
- ? [this.context, nextContext].join(this.config("contextSeparator"))
135
- : this.context;
136
- const key = combinedContext;
137
- let childPino = this.childLoggers.get(key);
138
- if (!childPino) {
139
- childPino =
140
- typeof this.pino.child === "function"
141
- ? this.pino.child(bindings, options)
142
- : this.pino;
143
- this.childLoggers.set(key, childPino);
144
- }
145
- const baseConfig = getPinoConfig(Logging.getConfig(), this.conf);
146
- const overrides = {
147
- pino: mergePinoConfig(baseConfig, { instance: childPino }),
148
- };
149
- if (nextContext) {
150
- return super.for(nextContext, overrides);
151
- }
152
- return super.for(overrides);
119
+ const childInstance = typeof this.pino.child === "function"
120
+ ? this.pino.child(bindings, options)
121
+ : this.pino;
122
+ const childLogger = new PinoLogger(nextContext ??
123
+ joinContext(this.context, this.config("contextSeparator") || "."), this.conf, childInstance);
124
+ childLogger.context = nextContext
125
+ ? [...this.context, nextContext]
126
+ : [...this.context];
127
+ return childLogger;
153
128
  }
154
129
  flush() {
155
- const target = this.activePino();
156
- if (typeof target.flush === "function") {
157
- return target.flush();
130
+ if (typeof this.pino.flush === "function") {
131
+ return this.pino.flush();
158
132
  }
159
133
  }
160
134
  get level() {
161
- const target = this.activePino();
162
- return target.level;
135
+ return this.pino.level;
163
136
  }
164
137
  set level(value) {
165
138
  if (!value)
166
139
  return;
167
- const target = this.activePino();
168
- target.level = value;
140
+ this.pino.level = value;
169
141
  const mapped = fromPinoLevel(value);
170
142
  if (mapped)
171
143
  this.setConfig({ level: mapped });
172
144
  }
173
145
  }
174
146
  /**
175
- * @description Factory function returning a Pino-backed logger.
176
- * @summary Allows registering the Pino logger with the global Logging facade.
147
+ * @description A factory for creating {@link PinoLogger} instances.
148
+ * @summary This factory function creates a new {@link PinoLogger} instance, and can optionally accept a pre-existing Pino logger instance.
149
+ * @const {LoggerFactory} PinoFactory
150
+ * @memberOf module:Logging
177
151
  */
178
152
  export const PinoFactory = (context, conf, ...args) => {
179
- const shallowClone = conf
180
- ? {
181
- ...conf,
182
- pino: conf.pino ? { ...conf.pino } : undefined,
183
- }
184
- : {};
185
- const normalized = shallowClone;
186
- const ensurePinoConfig = () => {
187
- const current = normalized.pino;
188
- if (current)
189
- return current;
190
- const fresh = {};
191
- normalized.pino = fresh;
192
- return fresh;
193
- };
194
- const [firstArg, secondArg] = args;
195
- if (isPinoLogger(firstArg)) {
196
- const pinoConfig = ensurePinoConfig();
197
- pinoConfig.instance = firstArg;
198
- }
199
- else if (firstArg) {
200
- const pinoConfig = ensurePinoConfig();
201
- pinoConfig.options = {
202
- ...(pinoConfig.options || {}),
203
- ...firstArg,
204
- };
205
- if (secondArg !== undefined)
206
- pinoConfig.destination = secondArg;
207
- }
208
- return new PinoLogger(context, normalized);
153
+ const [driver] = args;
154
+ return new PinoLogger(context, conf, driver);
209
155
  };
210
156
  //# sourceMappingURL=pino.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pino.js","sourceRoot":"","sources":["../../../src/pino/pino.ts"],"names":[],"mappings":"AAAA,OAAO,IAIN,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,wBAAmB;AAEjD,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,0BAAqB;AAI1D,MAAM,cAAc,GAAoC;IACtD,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM;IAC5B,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO;IACzB,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F,WAAW,CAAC,OAAO,GAAG,WAAW;YAC/B,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE,WAAW,CAAC;YAChC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;QACtB,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,KAAK;QACH,IAAI,OAAQ,IAAI,CAAC,IAAY,CAAC,KAAK,KAAK,UAAU,EAAE,CAAC;YACnD,OAAQ,IAAI,CAAC,IAAY,CAAC,KAAK,EAAE,CAAC;QACpC,CAAC;IACH,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;IACzB,CAAC;IAED,IAAI,KAAK,CAAC,KAAyB;QACjC,IAAI,CAAC,KAAK;YAAE,OAAO;QACnB,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACxB,MAAM,MAAM,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;QACpC,IAAI,MAAM;YAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;IAChD,CAAC;CACF;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAkB,CACxC,OAAgB,EAChB,IAA6B,EAC7B,GAAG,IAAW,EACd,EAAE;IACF,MAAM,CAAC,MAAM,CAAC,GAAG,IAAoC,CAAC;IACtD,OAAO,IAAI,UAAU,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AAC/C,CAAC,CAAC"}
package/lib/esm/text.d.ts CHANGED
@@ -1,34 +1,25 @@
1
1
  /**
2
2
  * @description Pads the end of a string with a specified character.
3
- * @summary Extends the input string to a specified length by adding a padding character to the end.
4
- * If the input string is already longer than the specified length, it is returned unchanged.
5
- *
3
+ * @summary This function extends the input string to a specified length by adding a padding character to the end. If the input string is already longer than the specified length, it is returned unchanged.
6
4
  * @param {string} str - The input string to be padded.
7
5
  * @param {number} length - The desired total length of the resulting string.
8
- * @param {string} [char=" "] - The character to use for padding. Defaults to a space.
6
+ * @param {string} [char=" "] - The character to use for padding.
9
7
  * @return {string} The padded string.
10
8
  * @throws {Error} If the padding character is not exactly one character long.
11
- *
12
9
  * @function padEnd
13
- *
14
10
  * @memberOf module:Logging
15
11
  */
16
12
  export declare function padEnd(str: string, length: number, char?: string): string;
17
13
  /**
18
- * @description Replaces placeholders in a string with provided values.
19
- * @summary Interpolates a string by replacing placeholders of the form ${variableName}
20
- * with corresponding values from the provided object. If a placeholder doesn't have
21
- * a corresponding value, it is left unchanged in the string.
22
- *
23
- * @param {string} input - The input string containing placeholders to be replaced.
24
- * @param {Record<string, number | string>} values - An object containing key-value pairs for replacement.
25
- * @param prefix
26
- * @param suffix
27
- * @param flags
28
- * @return {string} The interpolated string with placeholders replaced by their corresponding values.
29
- *
14
+ * @description Replaces placeholders in a string with the provided values.
15
+ * @summary This function interpolates a string by replacing placeholders of the form `${variableName}` with the corresponding values from the provided object. If a placeholder does not have a corresponding value, it is left unchanged in the string.
16
+ * @param {string} input - The input string containing the placeholders to be replaced.
17
+ * @param {Record<string, (number|string)>} values - An object containing key-value pairs for the replacement.
18
+ * @param {string} [prefix="${"] - The prefix for the placeholders.
19
+ * @param {string} [suffix="}"] - The suffix for the placeholders.
20
+ * @param {string} [flags="g"] - The regular expression flags to use.
21
+ * @return {string} The interpolated string with the placeholders replaced by their corresponding values.
30
22
  * @function patchPlaceholders
31
- *
32
23
  * @mermaid
33
24
  * sequenceDiagram
34
25
  * participant Caller
@@ -38,117 +29,88 @@ export declare function padEnd(str: string, length: number, char?: string): stri
38
29
  * patchString->>String.replace: Call with regex and replacement function
39
30
  * String.replace->>patchString: Return replaced string
40
31
  * patchString-->>Caller: Return patched string
41
- *
42
32
  * @memberOf module:Logging
43
33
  */
44
34
  export declare function patchPlaceholders(input: string, values: Record<string, number | string>, prefix?: string, suffix?: string, flags?: string): string;
45
35
  /**
46
36
  * @description Replaces occurrences of keys with their corresponding values in a string.
47
- * @summary Iterates through a set of key-value pairs and replaces all occurrences of each key
48
- * in the input string with its corresponding value. Supports regular expression flags for customized replacement.
49
- *
50
- * @param {string} input - The input string in which replacements will be made.
51
- * @param {Record<string, number | string>} values - An object containing key-value pairs for replacement.
52
- * @param {string} [flags="g"] - Regular expression flags to control the replacement behavior.
53
- * @return {string} The string with all specified replacements applied.
54
- *
37
+ * @summary This function iterates through a set of key-value pairs and replaces all occurrences of each key in the input string with its corresponding value. It supports regular expression flags for customized replacement.
38
+ * @param {string} input - The input string in which the replacements will be made.
39
+ * @param {Record<string, (number|string)>} values - An object containing key-value pairs for the replacement.
40
+ * @param {string} [flags="g"] - The regular expression flags to control the replacement behavior.
41
+ * @return {string} The string with all the specified replacements applied.
55
42
  * @function patchString
56
- *
57
43
  * @memberOf module:Logging
58
44
  */
59
45
  export declare function patchString(input: string, values: Record<string, number | string>, flags?: string): string;
60
46
  /**
61
47
  * @description Converts a string to camelCase.
62
- * @summary Transforms the input string into camelCase format, where words are joined without spaces
63
- * and each word after the first starts with a capital letter.
64
- *
48
+ * @summary This function transforms the input string into camelCase format, where words are joined without spaces and each word after the first starts with a capital letter.
65
49
  * @param {string} text - The input string to be converted.
66
50
  * @return {string} The input string converted to camelCase.
67
- *
68
51
  * @function toCamelCase
69
- *
70
52
  * @memberOf module:Logging
71
53
  */
72
54
  export declare function toCamelCase(text: string): string;
73
55
  /**
74
56
  * @description Converts a string to ENVIRONMENT_VARIABLE format.
75
- * @summary Transforms the input string into uppercase with words separated by underscores,
76
- * typically used for environment variable names.
77
- *
57
+ * @summary This function transforms the input string into uppercase with words separated by underscores, which is a format that is typically used for environment variable names.
78
58
  * @param {string} text - The input string to be converted.
79
59
  * @return {string} The input string converted to ENVIRONMENT_VARIABLE format.
80
- *
81
60
  * @function toENVFormat
82
- *
83
61
  * @memberOf module:Logging
84
62
  */
85
63
  export declare function toENVFormat(text: string): string;
86
64
  /**
87
65
  * @description Converts a string to snake_case.
88
- * @summary Transforms the input string into lowercase with words separated by underscores.
89
- *
66
+ * @summary This function transforms the input string into lowercase with words separated by underscores.
90
67
  * @param {string} text - The input string to be converted.
91
68
  * @return {string} The input string converted to snake_case.
92
- *
93
69
  * @function toSnakeCase
94
- *
95
70
  * @memberOf module:Logging
96
71
  */
97
72
  export declare function toSnakeCase(text: string): string;
98
73
  /**
99
74
  * @description Converts a string to kebab-case.
100
- * @summary Transforms the input string into lowercase with words separated by hyphens.
101
- *
75
+ * @summary This function transforms the input string into lowercase with words separated by hyphens.
102
76
  * @param {string} text - The input string to be converted.
103
77
  * @return {string} The input string converted to kebab-case.
104
- *
105
78
  * @function toKebabCase
106
- *
107
79
  * @memberOf module:Logging
108
80
  */
109
81
  export declare function toKebabCase(text: string): string;
110
82
  /**
111
83
  * @description Converts a string to PascalCase.
112
- * @summary Transforms the input string into PascalCase format, where words are joined without spaces
113
- * and each word starts with a capital letter.
114
- *
84
+ * @summary This function transforms the input string into PascalCase format, where words are joined without spaces and each word starts with a capital letter.
115
85
  * @param {string} text - The input string to be converted.
116
86
  * @return {string} The input string converted to PascalCase.
117
- *
118
87
  * @function toPascalCase
119
- *
120
88
  * @memberOf module:Logging
121
89
  */
122
90
  export declare function toPascalCase(text: string): string;
123
91
  /**
124
92
  * @description Escapes special characters in a string for use in a regular expression.
125
- * @summary Adds backslashes before characters that have special meaning in regular expressions,
126
- * allowing the string to be used as a literal match in a RegExp.
127
- *
93
+ * @summary This function adds backslashes before characters that have a special meaning in regular expressions, which allows the string to be used as a literal match in a RegExp.
128
94
  * @param {string} string - The string to escape for regular expression use.
129
- * @return {string} The escaped string safe for use in regular expressions.
130
- *
95
+ * @return {string} The escaped string that is safe for use in regular expressions.
131
96
  * @function escapeRegExp
132
- *
133
97
  * @memberOf module:Logging
134
98
  */
135
99
  export declare function escapeRegExp(string: string): string;
136
100
  /**
137
- * @summary Util function to provide string format functionality similar to C#'s string.format
138
- *
139
- * @param {string} string
140
- * @param {Array<string | number> | Record<string, any>} [args] replacements made by order of appearance (replacement0 wil replace {0} and so on)
141
- * @return {string} formatted string
142
- *
101
+ * @description A utility function that provides string formatting functionality that is similar to C#'s string.format.
102
+ * @summary This function replaces placeholders in a string with the provided arguments.
103
+ * @param {string} string - The string to format.
104
+ * @param {...(string|number|Record<string, any>)} args - The arguments to use for formatting.
105
+ * @return {string} The formatted string.
143
106
  * @function sf
144
107
  * @memberOf module:Logging
145
108
  */
146
109
  export declare function sf(string: string, ...args: (string | number | Record<string, any>)[]): string;
147
110
  /**
148
- * @summary Util function to provide string format functionality similar to C#'s string.format
149
- *
111
+ * @description A utility function that provides string formatting functionality that is similar to C#'s string.format.
112
+ * @summary This function is deprecated. Use {@link sf} instead.
150
113
  * @see sf
151
- *
152
114
  * @deprecated
153
115
  * @function stringFormat
154
116
  * @memberOf module:Logging