@punks/backend-core 0.0.58 → 0.0.60

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.
@@ -2,7 +2,7 @@ export * from "./array";
2
2
  export { addTime, subtractTime, TimeUnit } from "./dates";
3
3
  export { CsvColumnDefinition as ColumnDefinition, CsvBuildOptions, csvBuild, csvParse, } from "./csv";
4
4
  export { getDirectoryFilePaths } from "./files";
5
- export { joinPath, splitPath, ensureDirectory, getDirectoryPath } from "./paths";
5
+ export { joinPath, splitPath, ensureDirectory, getDirectoryPath, createDayPath, } from "./paths";
6
6
  export * from "./strings";
7
7
  export * from "./objects";
8
8
  export * from "./text";
@@ -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: Date, separator?: string) => string;
5
+ export declare const createDayPath: (d?: Date, separator?: string) => string;
package/dist/esm/index.js CHANGED
@@ -231,6 +231,9 @@ const ensureDirectory = (path) => {
231
231
  }
232
232
  };
233
233
  const getDirectoryPath = (filePath) => path.dirname(filePath);
234
+ const createDayPath = (d = new Date(), separator = "/") => `${d.getFullYear()}${separator}${(d.getMonth() + 1)
235
+ .toString()
236
+ .padStart(2, "0")}${separator}${d.getDate().toString().padStart(2, "0")}`;
234
237
 
235
238
  const trimStart = (str, value) => str.startsWith(value) ? str.substring(value.length) : str;
236
239
  const trimEnd = (str, value) => str.endsWith(value) ? str.substring(0, str.length - value.length) : str;
@@ -28494,26 +28497,26 @@ Log.container = {
28494
28497
  class ConsoleLogger {
28495
28498
  debug(loggerName, message, meta) {
28496
28499
  if (meta) {
28497
- console.log(`${loggerName ? `[${loggerName}] ` : ""}${message}`, meta);
28500
+ console.log(`\x1b[96m${loggerName ? `[${loggerName}] ` : ""}\x1b[0m${message}`, meta);
28498
28501
  }
28499
28502
  else {
28500
- console.log(`${loggerName ? `[${loggerName}] ` : ""}${message}`);
28503
+ console.log(`\x1b[96m${loggerName ? `[${loggerName}] ` : ""}\x1b[0m${message}`);
28501
28504
  }
28502
28505
  }
28503
28506
  info(loggerName, message, meta) {
28504
28507
  if (meta) {
28505
- console.info(`${loggerName ? `[${loggerName}] ` : ""}${message}`, meta);
28508
+ console.info(`\x1b[34m${loggerName ? `[${loggerName}] ` : ""}\x1b[0m${message}`, meta);
28506
28509
  }
28507
28510
  else {
28508
- console.info(`${loggerName ? `[${loggerName}] ` : ""}${message}`);
28511
+ console.info(`\x1b[34m${loggerName ? `[${loggerName}] ` : ""}\x1b[0m${message}`);
28509
28512
  }
28510
28513
  }
28511
28514
  warn(loggerName, message, meta) {
28512
28515
  if (meta) {
28513
- console.warn(`${loggerName ? `[${loggerName}] ` : ""}${message}`, meta);
28516
+ console.warn(`\x1b[33m${loggerName ? `[${loggerName}] ` : ""}\x1b[0m${message}`, meta);
28514
28517
  }
28515
28518
  else {
28516
- console.warn(`${loggerName ? `[${loggerName}] ` : ""}${message}`);
28519
+ console.warn(`\x1b[33m${loggerName ? `[${loggerName}] ` : ""}\x1b[0m${message}`);
28517
28520
  }
28518
28521
  }
28519
28522
  error(loggerName, message, meta) {
@@ -28631,5 +28634,5 @@ const processArrayItemMove = (items, input) => {
28631
28634
  }));
28632
28635
  };
28633
28636
 
28634
- export { ConsoleLogger, DatadogLogger, ExcelKeyTransform, Log, LogLevel, MetaSerializationType, addTime, buildObject, buildTree, byField, byFieldDesc, camelToKebabCase, camelToSnakeCase, csvBuild, csvParse, distinct, distinctElements, ensureDirectory, ensureStartSlash, ensureTailingSlash, excelBuild, excelParse, first, flatten, getDirectoryFilePaths, getDirectoryPath, groupBy, indexes, isNullOrUndefined, iterate, joinPath, jsonDistinct, jsonSerialize, last, logMemoryUsage, mapOrThrow, mergeDeep, newUuid, notNull, notUndefined, pluralize, processArrayDifferences, processArrayItemMove, range, removeUndefinedProps, selectMany, sleep, sort, splitPath, subArrays, subtractTime, toArrayDict, toCamelCase, toDict, toItemsDict, toItemsMap, toMap, toTitleCase, trim$1 as trim, trimEnd, trimStart };
28637
+ export { ConsoleLogger, DatadogLogger, ExcelKeyTransform, Log, LogLevel, MetaSerializationType, addTime, buildObject, buildTree, byField, byFieldDesc, camelToKebabCase, camelToSnakeCase, createDayPath, csvBuild, csvParse, distinct, distinctElements, ensureDirectory, ensureStartSlash, ensureTailingSlash, excelBuild, excelParse, first, flatten, getDirectoryFilePaths, getDirectoryPath, groupBy, indexes, isNullOrUndefined, iterate, joinPath, jsonDistinct, jsonSerialize, last, logMemoryUsage, mapOrThrow, mergeDeep, newUuid, notNull, notUndefined, pluralize, processArrayDifferences, processArrayItemMove, range, removeUndefinedProps, selectMany, sleep, sort, splitPath, subArrays, subtractTime, toArrayDict, toCamelCase, toDict, toItemsDict, toItemsMap, toMap, toTitleCase, trim$1 as trim, trimEnd, trimStart };
28635
28638
  //# sourceMappingURL=index.js.map