foundkey-js: fix no-param-reassign lint in acct.ts

This commit is contained in:
Norm 2022-09-06 11:36:21 -04:00
parent 6e4dbc1053
commit a16d7d9dc2
Signed by untrusted user: norm
GPG key ID: 7123E30E441E80DE

View file

@ -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 };
}