Documentation
¶
Overview ¶
Package lodash provides Go adapters for commonly used lodash/lodash-es functions.
Index ¶
- func CamelCase(s string) string
- func Capitalize(s string) string
- func Chunk[T any](arr []T, size int) [][]T
- func Clamp(n, lower, upper float64) float64
- func Compact[T comparable](arr []T) []T
- func Debounce(fn func(), waitMs int) func()
- func Difference[T comparable](a []T, others ...[]T) []T
- func Flatten[T any](arr [][]T) []T
- func GroupBy[T any, K comparable](arr []T, fn func(T) K) map[K][]T
- func Intersection[T comparable](arrs ...[]T) []T
- func IsEmpty(v any) bool
- func KebabCase(s string) string
- func KeyBy[T any, K comparable](arr []T, fn func(T) K) map[K]T
- func Omit[V any](obj map[string]V, keys ...string) map[string]V
- func Pick[V any](obj map[string]V, keys ...string) map[string]V
- func Range(args ...int) []int
- func SnakeCase(s string) string
- func SortBy[T any](arr []T, fn func(T) float64) []T
- func Throttle(fn func(), waitMs int) func()
- func Truncate(s string, length int) string
- func Uniq[T comparable](arr []T) []T
- func UniqBy[T any, K comparable](arr []T, fn func(T) K) []T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Debounce ¶
func Debounce(fn func(), waitMs int) func()
Debounce returns a function that delays invoking fn until after wait milliseconds.
func Difference ¶
func Difference[T comparable](a []T, others ...[]T) []T
Difference returns elements in a that are not in others.
func GroupBy ¶
func GroupBy[T any, K comparable](arr []T, fn func(T) K) map[K][]T
GroupBy groups elements by a key function.
func Intersection ¶
func Intersection[T comparable](arrs ...[]T) []T
Intersection returns elements present in all slices.
func KeyBy ¶
func KeyBy[T any, K comparable](arr []T, fn func(T) K) map[K]T
KeyBy creates a map keyed by the result of a function.
func Throttle ¶
func Throttle(fn func(), waitMs int) func()
Throttle returns a function that only invokes fn at most once per wait milliseconds.
func UniqBy ¶
func UniqBy[T any, K comparable](arr []T, fn func(T) K) []T
UniqBy returns unique elements using a key function.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.