Skip to content

Wrong value for camelize and decamelize when using 1 or 2 characters key #297

@ThmX

Description

@ThmX

Describe the bug
When using a key with only 2 characters, the value is not camelized nor decamelized correctly.

To Reproduce

assert humps.camelize("j1") == "J1"
assert humps.decamelize("J1") == "j1"

assert humps.camelize("x") == "X"
assert humps.decamelize("X") == "x"

Expected behavior

  • camelize should return J1 but got j1 instead.

  • decamelize should return j1 but got J1 instead.

  • camelize should return X but got x instead.

  • decamelize should return x but got X instead.

Desktop (please complete the following information):

  • OS: Macos
  • Browser None
  • Version 3.8.0

Additional context
#61 and #168

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions