Irregular rule for unitOfMeasure to unitsOfMeasure does not work
See original GitHub issueI tried adding
inflector.irregular('unitOfMeasure', 'unitsOfMeasure');
To my app and it doesn’t work, it hits /api/unitOfMeasure, it should now be hitting /api/unitsOfMeasure
I created a unit test in /tests/unit/inflector-test.js that fails on both asserts in latest master:
test('unit of measure', function(assert) {
inflector.irregular('unitOfMeasure', 'unitsOfMeasure');
assert.equal(inflector.singularize('unitsOfMeasure'), 'unitOfMeasure', 'irregular singularization rule was applied');
assert.equal(inflector.pluralize('unitOfMeasure'), 'unitsOfMeasure', 'irregular pluralization rule was applied');
});
I had a quick debug, it seems to find the irregular rule ok and populate substitution
in the for loop, but then I think the return in that loop of return word.replace(rule, substitution);
doesn’t do the job as word is unitOfMeasure
and rule is unitofmeasure
, so there is no match due to the casing?
Issue Analytics
- State:
- Created 8 years ago
- Comments:18 (9 by maintainers)
Top Results From Across the Web
List of unusual units of measurement - Wikipedia
Many of the unusual units of measurements listed here are colloquial measurements, units devised to compare a measurement to common and familiar objects....
Read more >Illegal unit of measure (pt inserted) - Overleaf
This lets LaTeX know that the image should be five centimetres wide. Using a unit which is not allowed in LaTeX: Another common...
Read more >How Many Scruples in a Dram? - Merriam-Webster
As weights increase, a dram is 3 scruples, an ounce is 8 drams, ... This work was at a scale so small that...
Read more >Problems with tense marking in children with specific ... - NCBI
First, there is clear evidence for problems with irregular as well as regular past tense in elicitation tasks.
Read more >Conversion factor worksheet with answers
Law of Sines and Cosines Worksheet (This sheet is a summative worksheet that ... Details: A conversion factor is nothing, but the number...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We aim todo whatever the rails inflector does, if someone wants to check we can decide if this is a bug or not.