emberjs / emberjs/ember-inflector
Irregular inflector behavior
- Dominant language
- TypeScript
- Stars
- 107
- Forks
- 78
- Avg merge
- 20h 58m
- Merged PRs (30d)
- 4
Description
Hello there,
I have these rules (among others) in my app.
``` javascript
inflector.irregular('arma-branca', 'armas-brancas');
inflector.irregular('acessorio-arma-branca', 'acessorios-armas-brancas');
```
With this config I get this result:

It seems the second irregular rule is never met, this [line](https://github.com/stefanpenner/ember-inflector/blob/master/addon/lib/system/inflector.js#L270) looks like the culprit. It checks for the end of the rule, so, strings ending the same way can respond wrongly.
Another thing I notice is that this code makes the irregular declaration order specific. If I invert the order like so:
``` javascript
inflector.irregular('acessorio-arma-branca', 'acessorios-armas-brancas');
inflector.irregular('arma-branca', 'armas-brancas');
```
I get the right result:

Can we make the irregulars check for the whole expression first?
Contributor guide
Assessment
This issue has not been assessed yet.