tools

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnyToInt64 added in v0.0.6

func AnyToInt64(value any) int64

func CleanupNames

func CleanupNames(s string) string

CleanupNames removes all non-alphanumeric characters

func ConstantStringFromRegex

func ConstantStringFromRegex(regex string) string

func Filter

func Filter[T any](input []T, predicate func(T) bool) []T

func Indent

func Indent(input string, spaces int) string

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 LowerCamelCase(s string) string

func Map

func Map[T any, O any](input []T, mapper func(T) O) []O

func RegexMatchesConstantString

func RegexMatchesConstantString(regex string) bool

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 Singularize(input string) string

func SnakeCase

func SnakeCase(s string) string

func StringInListEqualFold

func StringInListEqualFold(needle string, haystack []string) bool

func UpperCamelCase

func UpperCamelCase(s string) string

func UpperSnakeCase

func UpperSnakeCase(s string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL