Skip to content

Commit

Permalink
feat: allow no key transformations (#94)
Browse files Browse the repository at this point in the history
* feat: allow no key transformations

* refactor: don't convert to str unnecessarily
  • Loading branch information
cquick01 authored Feb 1, 2024
1 parent e09b95f commit 40ea64d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dataclass_wizard/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ class LetterCase(Enum):
# Converts strings (generally in camel case) to snake case.
# ex: `myFieldName` -> `my_field_name`
SNAKE = FuncWrapper(to_snake_case)
# Perfoms no conversion on strings.
# ex: `MY_FIELD_NAME` -> `MY_FIELD_NAME`
NONE = FuncWrapper(lambda s: s)

def __call__(self, *args):
return self.value.f(*args)

0 comments on commit 40ea64d

Please sign in to comment.