forked from FoundKeyGang/FoundKey
foundkey-js: fix no-param-reassign lint in acct.ts
This commit is contained in:
parent
6e4dbc1053
commit
a16d7d9dc2
1 changed files with 2 additions and 2 deletions
|
@ -4,8 +4,8 @@ export type Acct = {
|
|||
};
|
||||
|
||||
export function parse(acct: string): Acct {
|
||||
if (acct.startsWith('@')) acct = acct.substr(1);
|
||||
const split = acct.split('@', 2);
|
||||
const acct_ = acct.startsWith('@') ? acct.slice(1) : acct;
|
||||
const split = acct_.split('@', 2);
|
||||
return { username: split[0], host: split[1] || null };
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue