node.inflection icon indicating copy to clipboard operation
node.inflection copied to clipboard

camelize handles `/` improperly

Open maciejmyslinski opened this issue 5 years ago • 0 comments

Hey! I just found inflection.camelize('/') return ::

I consider it a bug since camelize should only care about underscore chars.

Once confirmed by an author that it's a bug, I'm happy to implement a fix.

Here is a code I used to encounter a bug:

const inflection = require('inflection');
const fc = require('fast-check');

describe('inflection', () => {
  it('camelizes properly', () => {
    fc.assert(
      fc.property(fc.string(), fc.context(), (text, context) => {
        const camelized = inflection.camelize(text);
        context.log(camelized);
        expect(camelized.length).toBeLessThanOrEqual(text.length);
      })
    );
  });
});

maciejmyslinski avatar Apr 08 '19 13:04 maciejmyslinski