You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dig is a very useful function. Since it uses a variadic argument to specify the keys, the caller needs to know them prior to calling it. While handy in most cases, this is a limitation for implementing more advanced templates partials and helpers where the helper receives the list of the keys as a parameter.
digFromDict (which dig already uses) has the signature that satisfies the requirements that was mentioned above and can be a complement to dig for special purposes. It just needs to be exposed.
The following example (for Helm) tries to depict this:
I want to make an additional note that this is a generic problem with functions with variadic arguments. They can be used in a limited settings and their usage can not be parametrized with lists. #330 is a similar issue.
dig
is a very useful function. Since it uses a variadic argument to specify the keys, the caller needs to know them prior to calling it. While handy in most cases, this is a limitation for implementing more advanced templates partials and helpers where the helper receives the list of the keys as a parameter.digFromDict
(whichdig
already uses) has the signature that satisfies the requirements that was mentioned above and can be a complement todig
for special purposes. It just needs to be exposed.The following example (for Helm) tries to depict this:
A helper like
"settings.helper"
can not be implemented withdig
.The text was updated successfully, but these errors were encountered: