electrode-io / electrode-confippet

node.js environment aware application configuration
Other
108 stars 18 forks source link

processConfig: don't force string result #17

Open wmertens opened 7 years ago

wmertens commented 7 years ago

If the template definition is the whole string, this change allows the result to be any type. That way you can have arrays etc as values from template expansion.

If you like this I can see about adding a test…

jchip commented 7 years ago

I'd thought about this and actually tried to implement something. However, in the end, once you trigger the template feature, it's all processing as string. So if you want template to replace with values other than string, then it's limited to only a single value replacement. How'd you want to handle that? Template replacement can only be a simple single reference if it's not to be string?

wmertens commented 7 years ago

Yes, it only works on a single template, but you also have the option of calling functions passed in the context.

And my solution for #12 is happy with just copying values from one part of the tree to another…

On Wed, Jun 7, 2017 at 7:15 AM Joel Chen notifications@github.com wrote:

I'd thought about this and actually tried to implement something. However, in the end, once you trigger the template feature, it's all processing as string. So if you want template to replace with values other than string, then it's limited to only a single value replacement. How'd you want to handle that? Template replacement can only be a simple single reference if it's not to be string?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/electrode-io/electrode-confippet/pull/17#issuecomment-306688922, or mute the thread https://github.com/notifications/unsubscribe-auth/AADWlhiQWnXLuQwQ7L9Z8FXaXAxOf8JWks5sBjIFgaJpZM4NxUPl .

CLAassistant commented 5 years ago

CLA assistant check
All committers have signed the CLA.