From 009981f3031d3cb03f77ec00188780e3994d4794 Mon Sep 17 00:00:00 2001 From: Gustavo Henke Date: Mon, 2 Sep 2024 00:53:13 +1000 Subject: [PATCH] Make sure empty lines have prefix --- src/logger.ts | 2 +- tsconfig.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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,