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

Implement coalesce helper #18

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Implement coalesce helper #18

wants to merge 1 commit into from

Conversation

thekid
Copy link
Member

@thekid thekid commented Oct 22, 2023

This pull request adds a helper which returns the first non-null argument.

This syntax:
{{#title}}{{.}}{{^}}Default{{/title}}

Can now be shortened to:
{{coalesce title "Default"}}

This is similar to the any helper but it returns the first non-null value (or null if there is none) instead of true or false.

@thekid thekid added the enhancement New feature or request label Oct 22, 2023
@thekid thekid mentioned this pull request Oct 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant