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
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:
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