We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
We should consider methods of supporting patterns for Config Variables that are the equivalent of:
{ url: `https://alchemy.com/api?key=${env.API_KEY}` }
A suggestion was to support templating maybe with a template library:
{ url: config.variable("https://alchemy.com/api?key={{API_KEY}}") }
Though I would consider template literals:
{ url: config.variable`https://alchemy.com/api?key=${"API_KEY"}` }
function configurationVariableResolver(name: string): string | null { if (name === "API_KEY") { return "secret" } return null } const config = { variable: (strings: TemplateStringsArray, ...keys: string[]): string => { return strings.reduce((result, str, i) => { const key = keys[i - 1]; return result + configurationVariableResolver(key) + str; }); }, } const example = { url: config.variable`https://alchemy.com/api?key=${"API_KEY"}` } console.log(example) // { // "url": "https://alchemy.com/api?key=secret" // }
The template literal example here would need to be changed to return a ConfigVariable object so it could be resolved later, but the principle stands.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
We should consider methods of supporting patterns for Config Variables that are the equivalent of:
A suggestion was to support templating maybe with a template library:
Though I would consider template literals:
The template literal example here would need to be changed to return a ConfigVariable object so it could be resolved later, but the principle stands.
The text was updated successfully, but these errors were encountered: