foundkey-js: fix no-param-reassign lint in acct.ts
All checks were successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/test Pipeline was successful

This commit is contained in:
Norm 2022-09-06 11:36:21 -04:00
parent 6e4dbc1053
commit a16d7d9dc2
Signed by: 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 };
}