summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-04-24 11:14:17 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-04-24 11:14:17 +0200
commit2c39b659a59bb308a1221c1ab949f774ed195e7c (patch)
treed22e62ed6629b9411480379ae0e48d8770add267
parent:bug: fix member model (diff)
downloadserver-2c39b659a59bb308a1221c1ab949f774ed195e7c.tar.xz
:art: String trimSpecial pass string OR undefined
-rw-r--r--.npmignore1
-rw-r--r--src/util/String.ts3
2 files changed, 3 insertions, 1 deletions
diff --git a/.npmignore b/.npmignore
new file mode 100644
index 00000000..05a9d0cf
--- /dev/null
+++ b/.npmignore
@@ -0,0 +1 @@
+!dist/
\ No newline at end of file
diff --git a/src/util/String.ts b/src/util/String.ts
index 407b669d..161336f1 100644
--- a/src/util/String.ts
+++ b/src/util/String.ts
@@ -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();
 }