Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Snake casing not idempotent for strings with a numeric character following a capitalized character #74

Open
fordN opened this issue Oct 29, 2019 · 0 comments

Comments

@fordN
Copy link

fordN commented Oct 29, 2019

Current behavior

to_snake_case("convertedAcquisitionV2Counter") => "converted_acquisition_v2_counter"
to_snake_case("converted_acquisition_v2_counter") => "converted_acquisition_v_2_counter"

Which also leads to:

is_snake_case(to_snake_case("convertedAcquisitionV2Counter")) => false

Expected behavior

to_snake_case("convertedAcquisitionV2Counter") => "converted_acquisition_v2_counter"
to_snake_case("converted_acquisition_v2_counter") => "converted_acquisition_v2_counter"
is_snake_case(to_snake_case("convertedAcquisitionV2Counter")) => true
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant