This repository was archived by the owner on Mar 26, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,7 +56,8 @@ def to_camel_case(s: str) -> str:
5656 s (str): The input string, provided in any sane case system
5757
5858 Returns:
59- str: The string in lower camel case with the first letter unchanged .
59+ str: The string in lower camel case.
6060 '''
61- items = re .split (r'[_-]' , s )
62- return items [0 ].capitalize () + "" .join (x .capitalize () for x in items [1 :])
61+
62+ items = re .split (r'[_-]' , to_snake_case (s ))
63+ return items [0 ].lower () + "" .join (x .capitalize () for x in items [1 :])
Original file line number Diff line number Diff line change @@ -28,15 +28,15 @@ def test_constant_to_snake():
2828
2929
3030def test_pascal_to_camel ():
31- assert case .to_camel_case ('PascalCaseThing' ) == 'PascalCaseThing '
31+ assert case .to_camel_case ('PascalCaseThing' ) == 'pascalCaseThing '
3232
3333
3434def test_snake_to_camel ():
3535 assert case .to_camel_case ('snake_case_thing' ) == 'snakeCaseThing'
3636
3737
3838def test_constant_to_camel ():
39- assert case .to_camel_case ('CONSTANT_CASE_THING' ) == 'ConstantCaseThing '
39+ assert case .to_camel_case ('CONSTANT_CASE_THING' ) == 'constantCaseThing '
4040
4141
4242def test_kebab_to_camel ():
You can’t perform that action at this time.
0 commit comments