Fixed formatting
All checks were successful
Test before pr merge / test-lint (pull_request) Successful in 7s

This commit is contained in:
2026-01-16 15:55:28 +01:00
parent 17408d5cd2
commit c8de1284fb

View File

@@ -18,15 +18,15 @@ class String:
String converted to CamelCase
"""
if re.search(r'[_\-\s]', s):
words = re.split(r'[_\-\s]+', s)
if re.search(r"[_\-\s]", s):
words = re.split(r"[_\-\s]+", s)
else:
words = re.findall(r'[A-Z]?[a-z]+|[A-Z]+(?=[A-Z]|$)', s)
words = re.findall(r"[A-Z]?[a-z]+|[A-Z]+(?=[A-Z]|$)", s)
words = [w.lower() for w in words if w]
if not words:
return ''
return words[0] + ''.join(w.capitalize() for w in words[1:])
return ""
return words[0] + "".join(w.capitalize() for w in words[1:])
@staticmethod
def to_pascal_case(s: str) -> str:
@@ -40,12 +40,12 @@ class String:
String converted to PascalCase
"""
if re.search(r'[_\-\s]', s):
words = re.split(r'[_\-\s]+', s)
if re.search(r"[_\-\s]", s):
words = re.split(r"[_\-\s]+", s)
else:
words = re.findall(r'[A-Z]?[a-z]+|[A-Z]+(?=[A-Z]|$)', s)
words = re.findall(r"[A-Z]?[a-z]+|[A-Z]+(?=[A-Z]|$)", s)
return ''.join(word.capitalize() for word in words if word)
return "".join(word.capitalize() for word in words if word)
@staticmethod
def to_snake_case(chars: str) -> str: