Some checks failed
Docs Deploy / build_and_deploy (push) Has been cancelled
Generate Docs / cli (push) Has been cancelled
Generate Config Doc / cli (push) Has been cancelled
Go formatting / go-formatting (push) Has been cancelled
Check links / markdown-link-check (push) Has been cancelled
Integration / pre-test (push) Has been cancelled
Integration / test on (push) Has been cancelled
Integration / status (push) Has been cancelled
Lint / Lint Go code (push) Has been cancelled
Test / test (ubuntu-latest) (push) Has been cancelled
37 lines
794 B
Go
37 lines
794 B
Go
package xstrcase
|
|
|
|
import (
|
|
"strings"
|
|
|
|
protogenerator "github.com/cosmos/gogoproto/protoc-gen-gogo/generator"
|
|
"github.com/iancoleman/strcase"
|
|
|
|
"git.cw.tr/mukan-network/mukan-ignite/ignite/pkg/xstrings"
|
|
)
|
|
|
|
// UpperCamel returns the name with upper camel and no special character.
|
|
func UpperCamel(name string) string {
|
|
return protogenerator.CamelCase(strcase.ToSnake(name))
|
|
}
|
|
|
|
// Lowercase returns the name with lower case and no special character.
|
|
func Lowercase(name string) string {
|
|
return strings.ToLower(
|
|
strings.ReplaceAll(
|
|
xstrings.NoDash(name),
|
|
"_",
|
|
"",
|
|
),
|
|
)
|
|
}
|
|
|
|
// Uppercase returns the name with upper case and no special character.
|
|
func Uppercase(name string) string {
|
|
return strings.ToUpper(
|
|
strings.ReplaceAll(
|
|
xstrings.NoDash(name),
|
|
"_",
|
|
"",
|
|
),
|
|
)
|
|
}
|