xlodash

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chunk

func Chunk[V any](list []V, size int) [][]V

Chunk ...

func Contains

func Contains[V comparable](list []V, target V) bool

Contains ...

func Diff

func Diff[V comparable](list []V, target []V) []V

Diff ...

func Filter

func Filter[V any](list []V, f func(int, V) bool) []V

Filter ...

func First

func First[V any](list []V, defaults ...V) V

First 取切片第一个元素, 不然取默认值第一个元素, 再则取对应类型的零值

func GroupBy

func GroupBy[K comparable, V any](list []V, f func(V) K) map[K][]V

GroupBy ...

func IndexOf

func IndexOf[V comparable](list []V, element V) int

IndexOf ...

func Intersect

func Intersect[V comparable](list []V, target []V) []V

Intersect ...

func Keys

func Keys[K comparable, V any](m map[K]V) []K

Keys ...

func LastIndexOf

func LastIndexOf[V comparable](list []V, element V) int

LastIndexOf ...

func Map

func Map[V any, R any](list []V, f func(int, V) R) []R

Map ...

func Max

func Max[V constraints.Ordered](nums ...V) V

Max ...

func Min

func Min[V constraints.Ordered](nums ...V) V

Min ...

func Union

func Union[V comparable](list []V, target []V) []V

Union ...

func Unique

func Unique[V comparable](list []V) []V

Unique ...

func Values

func Values[K comparable, V any](m map[K]V) []V

Values ...

Types

This section is empty.

Jump to

Keyboard shortcuts

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