Skip to content

Commit 9ec09d3

Browse files
authored
fix(app): 修正大驼峰转蛇形的逻辑 (#51)
1 parent afc20c7 commit 9ec09d3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lagrange/info/app.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from .serialize import JsonSerializer
66

77

8-
_T = TypeVar('_T', bound=dict[str, Union[int, str]])
8+
_T = TypeVar("_T", bound=dict[str, Union[int, str]])
99
_trans_map = {
1010
"SsoVersion": "pt_os_version",
1111
"WtLoginSdk": "wtlogin_sdk",
@@ -21,8 +21,8 @@ def _translate_appinfo(s: _T) -> _T:
2121
out[_trans_map[k]] = v
2222
else:
2323
k = re.sub(
24-
r'([A-Z])([^A-Z]+)',
25-
'_\0',
24+
r"([A-Z])([^A-Z]+)",
25+
r"_\1\2",
2626
k
2727
).lstrip("_").lower()
2828
out[k] = v

0 commit comments

Comments
 (0)