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
I'm working on a common library for a number of micro services that consume roughly the same environment variables. I'd like to provide definitions for all possible variables in my module, then allow each application to select the definitions they are interested in and ignore the rest.
I was thinking I could do this by wrapping the invocation of envalid.cleanEnv in my own function and pass a list of vars the application was interested in, something like this (the following code does not work FYI):
I can't figure out how to get the resulting object typed correctly, though. This is what I'm after:
// would be awesome to get this from the argument alone, instead of effectively duplicating the list in the generic argumentconstconfig=get<Var.BindAddr|Var.BindPort>([Var.BindAddr,Var.BindPort]);config.BIND_ADDR//=> should be present of type stringconfig.BIND_PORT//=> should be present of type numberconfig.JWK_FILE//=> should be absent
Does this make sense? Is this possible? How can I accomplish this?
The text was updated successfully, but these errors were encountered:
I'm working on a common library for a number of micro services that consume roughly the same environment variables. I'd like to provide definitions for all possible variables in my module, then allow each application to select the definitions they are interested in and ignore the rest.
I was thinking I could do this by wrapping the invocation of
envalid.cleanEnv
in my own function and pass a list of vars the application was interested in, something like this (the following code does not work FYI):I can't figure out how to get the resulting object typed correctly, though. This is what I'm after:
Does this make sense? Is this possible? How can I accomplish this?
The text was updated successfully, but these errors were encountered: