@nmakarov/cli-toolkit 0.16.0 → 0.18.0

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/init.cjs CHANGED
@@ -2152,6 +2152,7 @@ var ALL_LEVELS = [
2152
2152
  "response",
2153
2153
  "progress"
2154
2154
  ];
2155
+ var DEFAULT_LEVELS = ALL_LEVELS.filter((l) => l !== "silly");
2155
2156
  var MAX_LEVEL_LENGTH = Math.max(...ALL_LEVELS.map((level) => level.toUpperCase().length));
2156
2157
  var LEVEL_COLORS = {
2157
2158
  error: import_chalk.default.red.bold,
@@ -2237,7 +2238,7 @@ var Logger = class _Logger {
2237
2238
  silent: false,
2238
2239
  showLevel: false,
2239
2240
  timestamp: false,
2240
- levels: ALL_LEVELS,
2241
+ levels: DEFAULT_LEVELS,
2241
2242
  progressTimes: false,
2242
2243
  progressThrottle: void 0
2243
2244
  };
@@ -2397,15 +2398,17 @@ var Logger = class _Logger {
2397
2398
  }
2398
2399
  normalizeLevels(levels) {
2399
2400
  if (!levels || !levels.length) {
2400
- return ALL_LEVELS;
2401
+ return DEFAULT_LEVELS;
2401
2402
  }
2402
- const includes = levels.filter((level) => !level.startsWith("-"));
2403
- const excludes = levels.filter((level) => level.startsWith("-")).map((level) => level.slice(1));
2404
- const unknown = [...includes, ...excludes].filter((level) => !ALL_LEVELS.includes(level));
2403
+ const tokens = levels.map((t) => String(t).trim()).filter(Boolean);
2404
+ const explicitIncludes = tokens.filter((t) => !t.startsWith("+") && !t.startsWith("-")).map((t) => t);
2405
+ const addIncludes = tokens.filter((t) => t.startsWith("+")).map((t) => t.slice(1));
2406
+ const excludes = tokens.filter((t) => t.startsWith("-")).map((t) => t.slice(1));
2407
+ const unknown = [...explicitIncludes, ...addIncludes, ...excludes].filter((level) => !ALL_LEVELS.includes(level));
2405
2408
  if (unknown.length) {
2406
2409
  console.warn(`[Logger] Unknown level(s): ${unknown.join(", ")}`);
2407
2410
  }
2408
- const base = includes.length ? includes : ALL_LEVELS;
2411
+ const base = explicitIncludes.length ? explicitIncludes : Array.from(/* @__PURE__ */ new Set([...DEFAULT_LEVELS, ...addIncludes]));
2409
2412
  return base.filter((level) => !excludes.includes(level));
2410
2413
  }
2411
2414
  isValidMode(mode) {