From 5a91154eab83e43ac0dfbe2b15b673b94385bd33 Mon Sep 17 00:00:00 2001 From: Svilen Markov <7613769+svilenmarkov@users.noreply.github.com> Date: Sun, 13 Apr 2025 15:52:16 +0100 Subject: [PATCH] Document function --- docs/custom-api.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/custom-api.md b/docs/custom-api.md index 1930f40..d42d1fc 100644 --- a/docs/custom-api.md +++ b/docs/custom-api.md @@ -397,6 +397,7 @@ The following helper functions provided by Glance are available: - `sortByFloat(key string, order string, arr []JSON): []JSON`: Sorts an array of JSON objects by a float key in either ascending or descending order. - `sortByTime(key string, layout string, order string, arr []JSON): []JSON`: Sorts an array of JSON objects by a time key in either ascending or descending order. The format must be provided in Go's [date format](https://pkg.go.dev/time#pkg-constants). - `concat(strings ...string) string`: Concatenates multiple strings together. +- `unique(key string, arr []JSON) []JSON`: Returns a unique array of JSON objects based on the given key. The following helper functions provided by Go's `text/template` are available: