Skip to content

Commit

Permalink
fix(aliases): reduce the number of nonsense aliases (#312)
Browse files Browse the repository at this point in the history
  • Loading branch information
silasbw committed Aug 28, 2018
1 parent 50ac41f commit f0cd4c7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ module.exports.getAliases = function (resourceType) {
aliases = aliases.concat(resourceAliases[resourceType]);
}

//
// NOTE(sbw): try to catch things that shouldn't have singular aliases. This
// fails on some relatively common resources, like "status".
//
if (resourceType.slice(-1) !== 's') return aliases;

const trimLength = esPlurals[resourceType] ? 2 : 1;
const single = resourceType.substr(0, resourceType.length - trimLength);
aliases.push(single);
Expand Down

0 comments on commit f0cd4c7

Please sign in to comment.