summaryrefslogtreecommitdiff
path: root/src/misc/user/parse-acct.ts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-04-02 04:15:27 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-04-02 04:15:27 +0900
commitcd2542e0fd8578f6e41114ffebbda1f16f7d04ce (patch)
treec339b7808fc2a3d72ae30cb86ddb7b9c21852652 /src/misc/user/parse-acct.ts
parentRefactor (diff)
downloadsharkey-cd2542e0fd8578f6e41114ffebbda1f16f7d04ce.tar.gz
sharkey-cd2542e0fd8578f6e41114ffebbda1f16f7d04ce.tar.bz2
sharkey-cd2542e0fd8578f6e41114ffebbda1f16f7d04ce.zip
Refactor
Diffstat (limited to 'src/misc/user/parse-acct.ts')
-rw-r--r--src/misc/user/parse-acct.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/misc/user/parse-acct.ts b/src/misc/user/parse-acct.ts
new file mode 100644
index 0000000000..ef1f55405d
--- /dev/null
+++ b/src/misc/user/parse-acct.ts
@@ -0,0 +1,4 @@
+export default acct => {
+ const splitted = acct.split('@', 2);
+ return { username: splitted[0], host: splitted[1] || null };
+};