@punks/backend-core 0.0.59 → 0.0.61
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/dist/cjs/index.js +7 -7
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/logging/concrete/__test__/consoleLogger.spec.d.ts +1 -0
- package/dist/cjs/types/utils/paths.d.ts +1 -1
- package/dist/esm/index.js +7 -7
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/logging/concrete/__test__/consoleLogger.spec.d.ts +1 -0
- package/dist/esm/types/utils/paths.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -2,4 +2,4 @@ export declare const joinPath: (...paths: string[]) => string;
|
|
|
2
2
|
export declare const splitPath: (filePath: string) => string[];
|
|
3
3
|
export declare const ensureDirectory: (path: string) => void;
|
|
4
4
|
export declare const getDirectoryPath: (filePath: string) => string;
|
|
5
|
-
export declare const createDayPath: (d
|
|
5
|
+
export declare const createDayPath: (d?: Date, separator?: string) => string;
|
package/dist/esm/index.js
CHANGED
|
@@ -231,7 +231,7 @@ const ensureDirectory = (path) => {
|
|
|
231
231
|
}
|
|
232
232
|
};
|
|
233
233
|
const getDirectoryPath = (filePath) => path.dirname(filePath);
|
|
234
|
-
const createDayPath = (d, separator = "/") => `${d.getFullYear()}${separator}${(d.getMonth() + 1)
|
|
234
|
+
const createDayPath = (d = new Date(), separator = "/") => `${d.getFullYear()}${separator}${(d.getMonth() + 1)
|
|
235
235
|
.toString()
|
|
236
236
|
.padStart(2, "0")}${separator}${d.getDate().toString().padStart(2, "0")}`;
|
|
237
237
|
|
|
@@ -28497,26 +28497,26 @@ Log.container = {
|
|
|
28497
28497
|
class ConsoleLogger {
|
|
28498
28498
|
debug(loggerName, message, meta) {
|
|
28499
28499
|
if (meta) {
|
|
28500
|
-
console.log(
|
|
28500
|
+
console.log(`\x1b[96m${loggerName ? `[${loggerName}] ` : ""}${message}\x1b[0m`, meta);
|
|
28501
28501
|
}
|
|
28502
28502
|
else {
|
|
28503
|
-
console.log(
|
|
28503
|
+
console.log(`\x1b[96m${loggerName ? `[${loggerName}] ` : ""}${message}\x1b[0m`);
|
|
28504
28504
|
}
|
|
28505
28505
|
}
|
|
28506
28506
|
info(loggerName, message, meta) {
|
|
28507
28507
|
if (meta) {
|
|
28508
|
-
console.info(
|
|
28508
|
+
console.info(`\x1b[34m${loggerName ? `[${loggerName}] ` : ""}${message}\x1b[0m`, meta);
|
|
28509
28509
|
}
|
|
28510
28510
|
else {
|
|
28511
|
-
console.info(
|
|
28511
|
+
console.info(`\x1b[34m${loggerName ? `[${loggerName}] ` : ""}${message}\x1b[0m`);
|
|
28512
28512
|
}
|
|
28513
28513
|
}
|
|
28514
28514
|
warn(loggerName, message, meta) {
|
|
28515
28515
|
if (meta) {
|
|
28516
|
-
console.warn(
|
|
28516
|
+
console.warn(`\x1b[33m${loggerName ? `[${loggerName}] ` : ""}${message}\x1b[0m`, meta);
|
|
28517
28517
|
}
|
|
28518
28518
|
else {
|
|
28519
|
-
console.warn(
|
|
28519
|
+
console.warn(`\x1b[33m${loggerName ? `[${loggerName}] ` : ""}${message}\x1b[0m`);
|
|
28520
28520
|
}
|
|
28521
28521
|
}
|
|
28522
28522
|
error(loggerName, message, meta) {
|