Skip to content

Commit

Permalink
fix(core): fix a bug that logger does not formatting with empty string
Browse files Browse the repository at this point in the history
  • Loading branch information
async3619 committed Dec 8, 2022
1 parent c712e96 commit eab3be9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/utils/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ export class Logger implements Record<LogLevel, LoggerFn> {
}

for (const [, token, style] of matches) {
let item = replacements.shift() || "{}";
let item = replacements.shift();
if (typeof item === "undefined") {
item = "{}";
}

if (style) {
style.split(",").forEach(style => {
if (CHALK_FORMAT_NAMES.includes(style as any)) {
Expand Down

0 comments on commit eab3be9

Please sign in to comment.