1
0
mirror of https://github.com/pocketbase/pocketbase.git synced 2025-11-27 00:20:27 +02:00

added oauth2 jsvm name exception

This commit is contained in:
Gani Georgiev
2024-10-09 18:47:19 +03:00
parent 4d44f1cb5c
commit 0a60cdfde6
5 changed files with 16 additions and 1 deletions

View File

@@ -29,7 +29,13 @@ func (u FieldMapper) MethodName(_ reflect.Type, m reflect.Method) string {
return convertGoToJSName(m.Name)
}
var nameExceptions = map[string]string{"OAuth2": "oauth2"}
func convertGoToJSName(name string) string {
if v, ok := nameExceptions[name]; ok {
return v
}
startUppercase := make([]rune, 0, len(name))
for _, c := range name {