feat!: Add partial and permissive substitutions and recursive braced variables substitution#18
feat!: Add partial and permissive substitutions and recursive braced variables substitution#18D-Brox wants to merge 2 commits intofizyr:mainfrom
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:
Strictis identical to the previous behavior.Partialonly substitutes the variables that are in the variable map or that have defaults, keeping the ones that aren't defined.Permissivereplaces 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.