code: function getRole (args) {
    var roles = args.roles;
    var rank = args.rank;
    var name = args.name;
    var id = args.id;
    var search = rank || name || id;
    var found = {};
    var result = [];
    var isObject = search instanceof Object;
    for (var i = 0; i < roles.length; i++) {
      var role = roles[i];
      var find;
      if (rank) {
        find = role.Rank;
      } else if (name) {
        find = entities.decodeHTML(role.Name);
      } else if (id) {
        find = role.ID;
      }
      if (found[find]) {
        throw new Error('There are two or more roles with the rank ' + rank + '. You must specify the role name.');
      }
      var index = isObject ? search.indexOf(find) : 0;
      if (isObject ? index > -1 : search === find) {
        found[find] = true;
        result[index] = role;
      }
    }
    return isObject ? result : (result[0] || false);
  }
docs: Define