summary refs log tree commit diff
path: root/src/util/String.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-02-01 21:46:52 +0100
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-02-01 21:46:52 +0100
commit71585219116d7981051bceb284731e823ea47d58 (patch)
treef619f02b9d5a61a1a67b71d4ccedbad6305f1cef /src/util/String.ts
parent:sparkles: [Route] Login (diff)
downloadserver-71585219116d7981051bceb284731e823ea47d58.tar.xz
:sparkles: added Date + Email Body Type
Diffstat (limited to '')
-rw-r--r--src/util/String.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/util/String.ts b/src/util/String.ts
new file mode 100644

index 00000000..e7f014eb --- /dev/null +++ b/src/util/String.ts
@@ -0,0 +1,6 @@ +export const WHITE_SPACE = /\s\s+/g; +export const SPECIAL_CHAR = /[@#`:\r\n\t\f\v\p{C}]/gu; + +export function trim(str: string) { + return str.replace(SPECIAL_CHAR, "").replace(WHITE_SPACE, " ").trim(); +}