underscore.string icon indicating copy to clipboard operation
underscore.string copied to clipboard

decamelize implemented, tested and documentation updated

Open dgolman opened this issue 10 years ago • 10 comments

This is a pull request to add the decamelize feature requested by @stoeffel in #407

Added file decamelize.js, tests, and updated documentation.

dgolman avatar Dec 17 '15 20:12 dgolman

Hi, thanks for the PR. The following tests is what I would expect if you pass an empty string as the separator.

  equal(decamelize('theDecamelizeStringMethod_', ''), 'thedecamelizestringmethod_');

but the result is:

AssertionError: 'the_decamelize_string_method_' == 'thedecamelizestringmethod_'
+ expected 
- actual

+"thedecamelizestringmethod_"
-"the_decamelize_string_method_"

stoeffel avatar Dec 18 '15 07:12 stoeffel

@stoeffel - Great point. I didn't think about that case. The culprit for that is this separator || '_'

I will change it to reflect the test case you just presented.

dgolman avatar Dec 18 '15 15:12 dgolman

Could you squash your commits and remove the dist -file from the commit? Otherwise this LGTM. @epeli are you good on this?

stoeffel avatar Jan 13 '16 06:01 stoeffel

It's cool!

esamattis avatar Jan 13 '16 08:01 esamattis

@dgolman could you also squash your commits to one? http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html

stoeffel avatar Jan 14 '16 07:01 stoeffel

@stoeffel I think the squash worked this time. Check it out.

dgolman avatar Jan 14 '16 17:01 dgolman

Nope it didn't work. but I will do it for you as soon as I have time. Thanks for the PR.

stoeffel avatar Jan 14 '16 18:01 stoeffel

The latest commit has all the commits in it. Just curious what I missed for future reference.

On Thursday, January 14, 2016, Christoph Hermann [email protected] wrote:

Nope it didn't work. but I will do it for you as soon as I have time. Thanks for the PR.

— Reply to this email directly or view it on GitHub https://github.com/epeli/underscore.string/pull/467#issuecomment-171733308 .

dgolman avatar Jan 14 '16 18:01 dgolman

You can squash the commits into one and force push it to the branch so only one commit appears. I think I have once seen a nice guide. I will check and send you the link

stoeffel avatar Jan 14 '16 18:01 stoeffel

http://codeinthehole.com/writing/pull-requests-and-other-good-practices-for-teams-using-github/

stoeffel avatar Jan 14 '16 18:01 stoeffel