-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat!: Add partial and permissive substitutions and recursive braced variables substitution #18
base: main
Are you sure you want to change the base?
Conversation
I think I may need to add more to the documentation |
Thanks for the PR, and sorry for the delay! I've cherry-picked the fix to For the mode changes: I do like the idea of allowing the user to choose what to do on missing variables. But there is a bit of murky territory: If you have I also don't want to break backwards compatibility for adding this. To avoid that, I see two ways forward:
|
I see, there really is ambiguity in the About your suggestions, |
I added re-usable templates in #21. Maybe you can also look at that PR to evaluate if there is anything you think should be different to add multiple expansion modes in the future. |
I'll look at it over the weekend |
Allow three modes of substitution:
Strict
is identical to the previous behavior.Partial
only substitutes the variables that are in the variable map or that have defaults, keeping the ones that aren't defined.Permissive
replaces the variables with an empty string if they are not in the variable map.This PR also fixes recursive substitution to allow braced variables, soCherry-picked to main in 476997b${va1:${var2}}
is now also allowed.This is a breaking change, as the function signatures have changed.