fixed bug in camel case transformer
This commit is contained in:
parent
2a62ad7aba
commit
2517b45d44
@ -19,7 +19,8 @@ class Snake2CamelCaseKeyFormatter(Formatter):
|
|||||||
# If we wanted to do this properly, we would need handlers for all expected types and dispatch based
|
# If we wanted to do this properly, we would need handlers for all expected types and dispatch based
|
||||||
# on a type comparison. This is too much engineering for the limited use-case of this class though.
|
# on a type comparison. This is too much engineering for the limited use-case of this class though.
|
||||||
if isinstance(data, Iterable) and not isinstance(data, dict) and not isinstance(data, str):
|
if isinstance(data, Iterable) and not isinstance(data, dict) and not isinstance(data, str):
|
||||||
return type(data)(map(self.__format, data))
|
f = map(self.__format, data)
|
||||||
|
return type(data)(f) if not isinstance(data, map) else f
|
||||||
|
|
||||||
if not isinstance(data, dict):
|
if not isinstance(data, dict):
|
||||||
return data
|
return data
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user