Skip to content

Commit

Permalink
fix: make functions in LetterCase members of the enum
Browse files Browse the repository at this point in the history
  • Loading branch information
benberryallwood committed Sep 6, 2024
1 parent dc63902 commit 6b75a8c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions dataclasses_json/cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,13 @@ def __init__(self):


class LetterCase(Enum):
CAMEL = camelcase
KEBAB = spinalcase
SNAKE = snakecase
PASCAL = pascalcase
CAMEL = functools.partial(camelcase)
KEBAB = functools.partial(spinalcase)
SNAKE = functools.partial(snakecase)
PASCAL = functools.partial(pascalcase)

def __call__(self, string: str) -> str:
return self.value(string)


def config(metadata: Optional[dict] = None, *,
Expand Down

0 comments on commit 6b75a8c

Please sign in to comment.