Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undescore removes _ #77

Open
maciejmyslinski opened this issue Apr 8, 2019 · 1 comment
Open

undescore removes _ #77

maciejmyslinski opened this issue Apr 8, 2019 · 1 comment

Comments

@maciejmyslinski
Copy link

Hey there!

I just found inflection.underscore('_') returns '' (an empty string).

I bet it's a bug since this method should add, not remove, underscores.

Once confirmed by the author, I'm happy to implement a fix.

@maciejmyslinski
Copy link
Author

FYI here is a code for a test that found that bug:

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

describe('inflection', () => {
  it('underscores properly', () => {
    fc.assert(
      fc.property(fc.string(), text => {
        const underscored = inflection.underscore(text);
        expect(underscored.length).toBeGreaterThanOrEqual(text.length);
      }),
      { numRuns: 10000 }
    );
  });
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant