dotter: Add default variable template helper

This commit is contained in:
Marty Oehme 2025-09-21 10:43:49 +02:00
parent 0986892dce
commit e57cfb77fc
Signed by: Marty
GPG key ID: 4E535BC19C61886E
2 changed files with 13 additions and 0 deletions

View file

@ -0,0 +1,12 @@
// tests the type of variable passed in
// if 'no' type (does not exist or cant be parsed)
// we return the second, 'default' variable
fn choose(a, b) {
if type_of(a) != "()" {
return a;
}
return b;
}
choose(params[0], params[1])