fix: re-add highest property to RoleStore and GuildMemberRoleStore

closes #2302
This commit is contained in:
Lewdcario
2018-03-01 11:52:29 -06:00
parent 2a9fdef9e5
commit 9b41a6a8a6
2 changed files with 10 additions and 1 deletions

View File

@@ -106,7 +106,7 @@ class GuildMemberRoleStore extends DataStore {
* @readonly
*/
get highest() {
return this.reduce((prev, role) => !prev || role.comparePositionTo(prev) > 0 ? role : prev);
return this.reduce((prev, role) => role.comparePositionTo(prev) > 0 ? role : prev, this.first());
}
/**

View File

@@ -55,6 +55,15 @@ class RoleStore extends DataStore {
});
}
/**
* The role with the highest position in the store
* @type {Role}
* @readonly
*/
get highest() {
return this.reduce((prev, role) => role.comparePositionTo(prev) > 0 ? role : prev, this.first());
}
/**
* Data that can be resolved to a Role object. This can be:
* * A Role