🎨 String trimSpecial pass string OR undefined
This commit is contained in:
parent
92fcdc2a0b
commit
2c39b659a5
1
.npmignore
Normal file
1
.npmignore
Normal file
@ -0,0 +1 @@
|
||||
!dist/
|
@ -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();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user