utils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains[T comparable](array []T, item T) bool

Contains returns true if the item is in the array.

func Distinct

func Distinct[T comparable](array []T) []T

Distinct returns all distinc items in an array

func DistinctBy

func DistinctBy[T any, K comparable](array []T, f func(T) K) []T

DistinctBy returns the distinct members of the fn.

func IsAll

func IsAll[T any](array []T, f func(T) bool) bool

IsAll returns true if all the items in the array match the condition function.

func IsDistinct

func IsDistinct[T comparable](array []T) bool

IsDistinct returns true if all items in an array are distinct.

func IsNone

func IsNone[T any](array []T, f func(T) bool) bool

IsNone returns true if none of the items in the array match the condition function.

func IsSome

func IsSome[T any](array []T, f func(T) bool) bool

IsSome returns true if at least one item in the array matches the condition function.

func Reverse

func Reverse[T any](array []T) []T

Reverse returns the reverse of the original array.

Types

This section is empty.

Jump to

Keyboard shortcuts

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