Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SanitizeToIdentifier ¶
SanitizeToIdentifier converts a string into a valid Go identifier (CamelCase). It handles hyphens, underscores, and other non-alphanumeric characters by acting as delimiters for CamelCasing.
func ToKebabCase ¶
ToKebabCase converts a CamelCase string to kebab-case. It handles acronyms (e.g. JSONData -> json-data) and simple cases (CamelCase -> camel-case).
Types ¶
type NameAllocator ¶
type NameAllocator struct {
// contains filtered or unexported fields
}
NameAllocator manages the assignment of unique identifier names.
func NewNameAllocator ¶
func NewNameAllocator() *NameAllocator
NewNameAllocator creates a new allocator with pre-reserved names.
func (*NameAllocator) Allocate ¶
func (na *NameAllocator) Allocate(input string) string
Allocate generates a unique name based on the input string. It sanitizes the input and handles collisions by appending numbers.
type ParseOptions ¶ added in v0.0.20
Click to show internal directories.
Click to hide internal directories.