diff --git a/src/logger.ts b/src/logger.ts index 0568ebf6..3e7a3a41 100644 --- a/src/logger.ts +++ b/src/logger.ts @@ -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); } diff --git a/tsconfig.json b/tsconfig.json index 4bf31459..00f9eec8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "outDir": "./dist", "declaration": true, - "target": "ES2020", + "target": "ES2021", "module": "CommonJS", "moduleResolution": "node", "strict": true,