geetarista/underscore.inflections — pull request #5 by hmalphettes (2013-03-30 01:56:41+00:00)
Title: Avoid crashing on 'misc.' and other irregular words

When attempting to singularize 'misc.' underscore.inflections throws the following exception:

TypeError: Cannot read property '0' of null
at Inflections.apply_inflections (file://localhost/Users/hugues/proj/stoic-umbrella/underscore.inflections/lib/underscore.inflections.js:157:85)
at Inflections.apply_inflections (file://localhost/Users/hugues/proj/stoic-umbrella/underscore.inflections/lib/underscore.inflections.js:4:61)
at Inflections.singularize (file://localhost/Users/hugues/proj/stoic-umbrella/underscore.inflections/lib/underscore.inflections.js:151:19)
at Function.singularize (file://localhost/Users/hugues/proj/stoic-umbrella/underscore.inflections/lib/underscore.inflections.js:4:61)
at Context. (file://localhost/Users/hugues/proj/stoic-umbrella/underscore.inflections/test/inflections_test.js:222:13)

Here is the suggested fix.

I hope this helps and thanks for maintaining this library!