Remove use of deprecated trimLeft/trimRight

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2022-08-31 09:45:23 +02:00
parent a11e05c89c
commit 3d4f5daadf
4 changed files with 9 additions and 3 deletions
+6
View File
@@ -0,0 +1,6 @@
---
'@backstage/backend-common': patch
'@backstage/cli': patch
---
Remove use of deprecated trimLeft/trimRight
@@ -34,7 +34,7 @@ export function requestLoggingHandler(logger?: Logger): RequestHandler {
return morgan('combined', {
stream: {
write(message: String) {
actualLogger.info(message.trimRight());
actualLogger.info(message.trimEnd());
},
},
});
+1 -1
View File
@@ -101,7 +101,7 @@ export async function command(opts: OptionValues): Promise<void> {
if (resultText) {
console.log();
console.log(chalk.red(`Lint failed in ${relativeDir}:`));
console.log(resultText.trimLeft());
console.log(resultText.trimStart());
failed = true;
}
+1 -1
View File
@@ -31,7 +31,7 @@ export function spawnPiped(cmd: string[], options?: SpawnOptions) {
return (data: Buffer) => {
const prefixedMsg = data
.toString('utf8')
.trimRight()
.trimEnd()
.replace(/^/gm, prefix);
stream.write(`${prefixedMsg}\n`, 'utf8');
};