Skip to content

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

@syntax-e

Description

@syntax-e

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions