Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default template functions #32

Open
7 tasks
technosophos opened this issue Feb 11, 2022 · 0 comments
Open
7 tasks

default template functions #32

technosophos opened this issue Feb 11, 2022 · 0 comments

Comments

@technosophos
Copy link
Collaborator

Per #25, implement the Sprig functions for Bartholomew. Rather than file an issue for each function, I figured I'd break these down into small batches. (Note: I am not entirely sure all of the functions can be done with the same syntax. I am no pro in writing the Handlebars functions.)

  • default DEFAULT_VALUE TEST If TEST is not truthy, return the DEFAULT_VALUE. https://masterminds.github.io/sprig/defaults.html
  • empty TEST if TEST is "empty", return boolean true, otherwise return false
  • all_empty A B C returns boolean true if all of the varargs are empty (OPTIONAL. Not sure if we need)
  • all A B C returns boolean true if all of the varargs are non-empty (OPTIONAL. Not sure if we need)
  • any A B C returns boolean true if any of the varargs are non-empty (OPTIONAL. Not sure if we need)
  • coalesce LIST return the first non-empty item in the list. Extra good: if we can do Sprig's coalesce A B C.... with varargs, returning the first non-empty arg
  • ternary TRUE_VAL FALSE_VAL TEST If TEST is true, return TRUE_VAL, otherwise return FALSE_VAL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant