add pre_deploy.sh script for dotter

This commit is contained in:
Alexander Navarro 2024-11-19 15:48:29 -03:00
parent 808cdb3201
commit d93bf44ae0
7 changed files with 192 additions and 16 deletions

View file

@ -0,0 +1,30 @@
/*
* Flatten a table into a list of values.
* The table has to be in the form of
* ```toml
* [table.subtable]
* variable1 = ["value1", "value2"]
*
* [table.subtable]
* variable2 = ["value3", "value4"]
*
* then we use it in handlerbars like this:
*
* {{ flatten_table table.subtable }}
*
* and it will return an array with all the arrays of subtable
*/
if type_of(params[0]) != "map" {
return;
}
let table = params[0];
let result = [];
for value in table.values() {
result.append(value);
}
result