Skip to content

Commit

Permalink
Make sure empty lines have prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavohenke committed Sep 1, 2024
1 parent e7a15fc commit 009981f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ export class Logger {
this.emit(command, prefix);
}

const textToWrite = text.replace(/\n(.)/g, `\n${prefix}$1`);
const textToWrite = text.replaceAll('\n', (lf, i) => lf + (text[i + 1] ? prefix : ''));
this.emit(command, textToWrite);
}

Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"outDir": "./dist",
"declaration": true,
"target": "ES2020",
"target": "ES2021",
"module": "CommonJS",
"moduleResolution": "node",
"strict": true,
Expand Down

0 comments on commit 009981f

Please sign in to comment.