Skip to content

Fix underscore for single word#412

Open
az7arul wants to merge 2 commits into
esamattis:masterfrom
az7arul:fix-underscore-for-single-word
Open

Fix underscore for single word#412
az7arul wants to merge 2 commits into
esamattis:masterfrom
az7arul:fix-underscore-for-single-word

Conversation

@az7arul

@az7arul az7arul commented Mar 16, 2015

Copy link
Copy Markdown
Contributor

No description provided.

@az7arul

az7arul commented Mar 16, 2015

Copy link
Copy Markdown
Contributor Author

@az7arul

az7arul commented May 30, 2015

Copy link
Copy Markdown
Contributor Author

any feedback on this ?

@stoeffel

Copy link
Copy Markdown
Collaborator

I will check it tomorrow

@stoeffel

Copy link
Copy Markdown
Collaborator

I think if we change the behaviour of underscored we should change dasherize too.
WIth your change they would behave differently.
i.e.

dasherize('oneAtATime'); // => 'one-at-a-time'
dasherize('ATime'); // => '-a-time'
dasherize('ONETime'); // => '-o-n-e-time'

underscored('oneAtATime'); // => 'one_at_a_time'
underscored('ATime'); // => 'a_time'
underscored('ONETime'); // => 'one_time'

The only different should be that dasherize prefixes the sting with a dash if it starts with an uppercase.

@epeli do you agree that we should change both functions to the behaviour proposed by @az7arul ?

btw. related #89 #156

Comment thread underscored.js Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this not have to be global (test case please)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup it needs to be global

@az7arul az7arul force-pushed the fix-underscore-for-single-word branch from 63450a0 to 996afda Compare June 2, 2015 19:38
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

Successfully merging this pull request may close these issues.

3 participants