mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-15 05:41:51 +00:00
utility: sort !roles by name
This commit is contained in:
parent
41dd33c2d9
commit
69fc5f5df5
1 changed files with 6 additions and 0 deletions
|
@ -96,6 +96,12 @@ export class UtilityPlugin extends ZeppelinPlugin {
|
|||
roles = roles.filter(r => r.toLowerCase().includes(searchStr));
|
||||
}
|
||||
|
||||
roles.sort((a, b) => {
|
||||
if (a.toLowerCase() > b.toLowerCase()) return 1;
|
||||
if (a.toLowerCase() < b.toLowerCase()) return -1;
|
||||
return 0;
|
||||
});
|
||||
|
||||
const chunks = chunkArray(roles, 20);
|
||||
for (const [i, chunk] of chunks.entries()) {
|
||||
if (i === 0) {
|
||||
|
|
Loading…
Add table
Reference in a new issue