Skip to content

Commit 755eec9

Browse files
authored
add hyphen to snake-case util function (#12463)
1 parent 9e03371 commit 755eec9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

localstack-core/localstack/utils/strings.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ def snake_to_camel_case(string: str, capitalize_first: bool = True) -> str:
7878
return "".join(components)
7979

8080

81+
def hyphen_to_snake_case(string: str) -> str:
82+
return string.replace("-", "_")
83+
84+
8185
def canonicalize_bool_to_str(val: bool) -> str:
8286
return "true" if str(val).lower() == "true" else "false"
8387

0 commit comments

Comments
 (0)