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

Adding toBool / toBoolean methods and tests #186

Merged
merged 2 commits into from
Jul 10, 2013

Conversation

deleteman
Copy link
Contributor

This pull request references issue #185

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@@ -608,6 +608,16 @@
}

return current.pop();
},
toBoolean: function(str) {
Copy link

Choose a reason for hiding this comment

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

how about i18n?

toBoolean(str, trueString, falseString)

or better if you have many true or false strings...

toBoolean(str, trueRegex, falseRegex)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey, thanks, I've added a new commit with a modification based on you comments.

Copy link

Choose a reason for hiding this comment

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

wow! great modifications! :-) thx

esamattis added a commit that referenced this pull request Jul 10, 2013
Also document it and add more tests
@esamattis esamattis merged commit 083cc2d into esamattis:master Jul 10, 2013
@esamattis
Copy link
Owner

Merged, but changed the behaviour a bit. Mainly the match must be now exact. _.toBoolean("foo true bar") is now undefined instead of true.

@deleteman
Copy link
Contributor Author

Awesome, thanks!

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.

None yet

3 participants