From 3921c4a2dd211e3e1649a0507859fc98c8790f00 Mon Sep 17 00:00:00 2001 From: Gentris Leci Date: Tue, 1 Apr 2025 00:42:22 +0200 Subject: [PATCH] Add hyphen to snake-case function --- localstack-core/localstack/utils/strings.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/localstack-core/localstack/utils/strings.py b/localstack-core/localstack/utils/strings.py index 33f5f203a3d66..4c0310f4d3e3a 100644 --- a/localstack-core/localstack/utils/strings.py +++ b/localstack-core/localstack/utils/strings.py @@ -78,6 +78,10 @@ def snake_to_camel_case(string: str, capitalize_first: bool = True) -> str: return "".join(components) +def hyphen_to_snake_case(string: str) -> str: + return string.replace("-", "_") + + def canonicalize_bool_to_str(val: bool) -> str: return "true" if str(val).lower() == "true" else "false"