Sprig List

Sprig List #

all #

func all(args ...interface{}) bool
Filters items out of a list.

Aliases #

  • without

any #

func any(args ...interface{}) bool
Takes a list of values and returns true if any values are non-empty.

appendSprig #

func appendSprig(arg1 interface{}, arg2 interface{}) []interface{}
Append a new item to an existing list, creating a new list.

Aliases #

  • append

chunk #

func chunk(nbChunks int, list interface{}) [][]interface{}
Split a list into chunks of given size, use chunk size list. This is
useful for pagination.

concatSprig #

func concatSprig(args ...interface{}) interface{}
Concatenate arbitrary number of lists into one.

Aliases #

  • concat

first #

func first(arg1 interface{}) interface{}
Get the head item on a list.

hasSprig #

func hasSprig(arg1 interface{}, arg2 interface{}) bool
Test to see if a list has a particular element.

Aliases #

  • has

initialSprig #

func initialSprig(arg1 interface{}) []interface{}
Complements last by returning all but the last element.

Aliases #

  • initial

last #

func last(arg1 interface{}) interface{}
Get the last item on a list.

prependSprig #

func prependSprig(arg1 interface{}, arg2 interface{}) []interface{}
Push an element onto the front of a list, creating a new list.

Aliases #

  • prepend

pushSprig #

func pushSprig(arg1 interface{}, arg2 interface{}) []interface{}
Append a new item to an existing list, creating a new list.

Aliases #

  • push

restSprig #

func restSprig(arg1 interface{}) []interface{}
Get the tail of the list (everything but the first item).

Aliases #

  • rest

reverseSprig #

func reverseSprig(arg1 interface{}) []interface{}
Produce a new list with the reversed elements of the given list.

Aliases #

  • reverse

sliceSprig #

func sliceSprig(arg1 interface{}, args ...interface{}) interface{}
Get partial elements of a list.

Aliases #

  • slice

uniqSprig #

func uniqSprig(arg1 interface{}) []interface{}
Generate a list with all of the duplicates removed.

Aliases #

  • uniq