From cd2542e0fd8578f6e41114ffebbda1f16f7d04ce Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 2 Apr 2018 04:15:27 +0900 Subject: Refactor --- src/misc/user/parse-acct.ts | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 src/misc/user/parse-acct.ts (limited to 'src/misc/user/parse-acct.ts') 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 }; +}; -- cgit v1.2.3-freya