From 74e14d6e2bf40cee084c6b48e8001a5784b750dc Mon Sep 17 00:00:00 2001 From: Tobias Kohr Date: Tue, 21 Nov 2023 11:08:18 +0100 Subject: [PATCH] refactor(utils): simplify removeWhitespace --- libs/util/shared/src/lib/utils/remove-whitespace.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/util/shared/src/lib/utils/remove-whitespace.ts b/libs/util/shared/src/lib/utils/remove-whitespace.ts index 696d88f457..053514cd52 100644 --- a/libs/util/shared/src/lib/utils/remove-whitespace.ts +++ b/libs/util/shared/src/lib/utils/remove-whitespace.ts @@ -1,3 +1,3 @@ export const removeWhitespace = function (str: string): string { - return str ? str.replace(/\s+/g, ' ').trim() : undefined + return str?.replace(/\s+/g, ' ').trim() }