[x] default: Give a default value. Used like this: trim " "| default "empty".
Since trim produces an empty string, the default value is returned. For
things with a length (strings, slices, maps), len(0) will trigger the default.
For numbers, the value 0 will trigger the default. For booleans, false will
trigger the default. For structs, the default is never returned (there is
no clear empty condition). For everything else, nil value triggers a default.
[ ] empty: Return true if the given value is the zero value for its type.
Caveats: structs are always non- [ ]empty. This should match the behavior of
{{if pipeline}}, but can be used inside of a pipeline.
[ ] coalesce: Given a list of items, return the first non-empty one.
This follows the same rules as 'empty'. '{{ coalesce .someVal 0 "hello" }} will return.someVal` if set, or else return "hello". The 0 is skipped
because it is an empty value.
[ ] compact: Return a copy of a list with all of the empty values removed.
'list 0 1 2 "" | compact' will return '[1 2]'
will return
.someVal` if set, or else return "hello". The 0 is skipped because it is an empty value.