Refactoring: updated data & sites storing, tests added

This commit is contained in:
Soxoj
2021-01-03 23:48:33 +03:00
parent 9d3e2d114c
commit d389ba9e76
7 changed files with 18572 additions and 20732 deletions
+13
View File
@@ -0,0 +1,13 @@
import re
class CaseConverter:
@staticmethod
def camel_to_snake(camelcased_string: str):
return re.sub(r'(?<!^)(?=[A-Z])', '_', camelcased_string).lower()
@staticmethod
def snake_to_camel(snakecased_string: str):
formatted = ''.join(word.title() for word in snakecased_string.split('_'))
result = formatted[0].lower() + formatted[1:]
return result