diff options
Diffstat (limited to 'src/misc/acct.ts')
| -rw-r--r-- | src/misc/acct.ts | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/misc/acct.ts b/src/misc/acct.ts index 16876c4429..5106b1a09e 100644 --- a/src/misc/acct.ts +++ b/src/misc/acct.ts @@ -1,13 +1,10 @@ -export type Acct = { - username: string; - host: string | null; -}; +import * as Misskey from 'misskey-js'; -export const getAcct = (user: Acct) => { +export const getAcct = (user: Misskey.Acct) => { return user.host == null ? user.username : `${user.username}@${user.host}`; }; -export const parseAcct = (acct: string): Acct => { +export const parseAcct = (acct: string): Misskey.Acct => { if (acct.startsWith('@')) acct = acct.substr(1); const split = acct.split('@', 2); return { username: split[0], host: split[1] || null }; |