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

camelizeKeys not converting if key starts with upper case letter. #6

Open
syntax-e opened this issue Feb 19, 2019 · 0 comments
Open

Comments

@syntax-e
Copy link

syntax-e commented Feb 19, 2019

Package: "xcase": "^2.0.1"

Repro

camelizeKeys({ Key: 'value' })

Observe result:
{Key: 'value'}

Expected:
{key: 'value'}

This behavior appears to originate here:

if (isDigit(firstChar) || isUpper(firstChar) || firstChar == separator) {

isUpper(firstChar) causes the method to return without modifying the key and

if (isUpper(firstChar)) {
never gets a chance to execute.

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