🎨 String trimSpecial pass string OR undefined
This commit is contained in:
@@ -0,0 +1 @@
|
||||
!dist/
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
import { DOUBLE_WHITE_SPACE, SPECIAL_CHAR } from "./Regex";
|
||||
|
||||
export function trimSpecial(str: string) {
|
||||
export function trimSpecial(str?: string) {
|
||||
if (!str) return;
|
||||
return str.replace(SPECIAL_CHAR, "").replace(DOUBLE_WHITE_SPACE, " ").trim();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user