array
local array = import "github.com/jsonnet-libs/xtd/array.libsonnet"
array implements helper functions for processing arrays.
Index
fn chunkArray(arr, maxSize)fn filterMapWithIndex(filter_func, map_func, arr)fn slice(indexable, index, end='null', step=1)
Fields
fn chunkArray
chunkArray(arr, maxSize)
chunkArray chunks an array into smaller arrays of the given max size.
fn filterMapWithIndex
filterMapWithIndex(filter_func, map_func, arr)
filterMapWithIndex works the same as std.filterMap with the addition that the index is passed to the functions.
filter_func and map_func function signature: function(index, array_item)
fn slice
slice(indexable, index, end='null', step=1)
slice works the same as std.slice but with support for negative index/end.