Documentation
¶
Index ¶
- func AnyToInt64(value any) int64
- func CleanupNames(s string) string
- func ConstantStringFromRegex(regex string) string
- func Filter[T any](input []T, predicate func(T) bool) []T
- func Indent(input string, spaces int) string
- func ItemInList[T comparable](needle T, haystack []T) bool
- func Keys[K comparable, V any](inputMap map[K]V) []K
- func LowerCamelCase(s string) string
- func Map[T any, O any](input []T, mapper func(T) O) []O
- func RegexMatchesConstantString(regex string) bool
- func Singularize(input string) string
- func SnakeCase(s string) string
- func StringInListEqualFold(needle string, haystack []string) bool
- func ToPtr[T any](v T) *T
- func UniqueFormatted[T any](items []T, format func(T) string) []string
- func UniqueFormattedBy[T any, F any](items []T, format func(T) F, keyFn func(F) string) []F
- func UpperCamelCase(s string) string
- func UpperSnakeCase(s string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnyToInt64 ¶ added in v0.0.6
func CleanupNames ¶
CleanupNames removes all non-alphanumeric characters
func ConstantStringFromRegex ¶
func ItemInList ¶
func ItemInList[T comparable](needle T, haystack []T) bool
func Keys ¶
func Keys[K comparable, V any](inputMap map[K]V) []K
func LowerCamelCase ¶
func RegexMatchesConstantString ¶
RegexMatchesConstantString naive way of checking if the input regex describes a constant string, or something else. ex: `^math$` or `^reduce$` would return true, while `^foo[0-9]+$` wouldn't
func Singularize ¶
func StringInListEqualFold ¶
func UniqueFormatted ¶ added in v0.1.6
UniqueFormatted applies format to each item in items and returns unique results, preserving order. Two formatted results are considered equal if they produce the same string.
func UniqueFormattedBy ¶ added in v0.1.6
UniqueFormattedBy applies format to each item, deduplicates by the string produced by keyFn, and returns unique formatted results, preserving order.
func UpperCamelCase ¶
func UpperSnakeCase ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.