Skip to content

camelize handles / improperly #78

Open
@maciejmyslinski

Description

@maciejmyslinski

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);
      })
    );
  });
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions