An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 5.8% dependent packages on proxy.golang.org
Top 4.7% dependent repos on proxy.golang.org

proxy.golang.org : github.com/goloop/scs

Package scs (String Case Style) implements methods for converting string cases between different naming conventions: camelCase, kebab-case, PascalCase, and snake_case. The package supports four main case styles: The package provides two main ways to work with string case styles: Direct conversion functions: str := scs.StrToCamel("hello-world") // returns "helloWorld" str := scs.StrToKebab("HelloWorld") // returns "hello-world" str := scs.StrToPascal("hello_world") // returns "HelloWorld" str := scs.StrToSnake("helloWorld") // returns "hello_world" Object-oriented approach using StringCaseStyle: style, _ := scs.New(scs.Camel, "hello-world") style.Value() // returns "helloWorld" style.ToKebab() // converts to kebab-case style.Value() // returns "hello-world" The package handles special cases like abbreviations and numbers: All functions in this package are thread-safe and can be used concurrently. The StringCaseStyle object methods are not thread-safe and should be protected if used concurrently. The package uses optimized regular expressions and string operations to provide efficient case conversions. Benchmark tests are available in the scs_test.go file. Conversion functions that require specific input formats (like CamelToKebab) return errors if the input string doesn't match the expected format. The StringCaseStyle object provides methods to check if conversions were successful.

Registry - Source - Documentation - JSON - codemeta.json
purl: pkg:golang/github.com/goloop/scs
Keywords: camel , camel-case , camelcase , case-style , golang , kebab , kebab-case , kebabcase , pascal , pascal-case , pascalcase , snake , snake-case , snakecase
License: MIT
Latest release: 11 months ago
First release: almost 5 years ago
Namespace: github.com/goloop
Dependent packages: 1
Dependent repositories: 1
Stars: 3 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 11 days ago

    Loading...
    Readme
    Loading...