exclude by rank (#132)

* exclude by rank

* Add a description of the ranks
This commit is contained in:
('o mo)y-˜ 2022-04-11 00:42:22 +09:00 • committed by GitHub
parent 3217ae3827
commit 6fa963b76e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View file

@ -140,6 +140,13 @@ If you want to specify multiple ranks.
https://github-profile-trophy.vercel.app/?username=ryo-ma&rank=S,AAA
```
You can also exclude ranks.
```
https://github-profile-trophy.vercel.app/?username=ryo-ma&rank=-C,-B
```
## Specify the maximum row & column size
You can specify the maximum row and column size.

View file

@ -58,6 +58,12 @@ export class TrophyList {
});
}
filterByRanks(ranks: Array<string>) {
if (ranks.filter((rank) => rank.includes("-")).length !== 0) {
this.trophies = this.trophies.filter((trophy) =>
!ranks.map(rank => rank.substring(1)).includes(trophy.rank)
)
return
}
this.trophies = this.trophies.filter((trophy) =>
ranks.includes(trophy.rank)
);