1
0
mirror of https://github.com/schollz/cowyo.git synced 2023-08-10 21:13:00 +03:00
cowyo/vendor/dmitri.shuralyov.com/kebabcase/kebabcase.go

19 lines
481 B
Go
Raw Normal View History

2017-10-03 21:43:55 +03:00
// Package kebabcase provides a parser for identifier names
// using kebab-case naming convention.
//
// Reference: https://en.wikipedia.org/wiki/Naming_convention_(programming)#Multiple-word_identifiers.
package kebabcase
import (
"strings"
"github.com/shurcooL/graphql/ident"
)
// Parse parses a kebab-case identifier name.
//
// E.g., "client-mutation-id" -> {"client", "mutation", "id"}.
func Parse(name string) ident.Name {
return ident.Name(strings.Split(name, "-"))
}