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
Using version 1.0.0 on node v6.9.4:
const format = require("string-template") const compile = require("string-template/compile") const vars = { hostName: 'my.only.host.com', host_tenant: 'only', host_lane: 'prd', subdomain: 'my.only', } console.log(format('http://{hostName}-{host_tenant}-{host_lane}-{subdomain}', vars)) // Logs out "http://my.only.host.com-only-prd-my.only" const template = compile('http://{hostName}-{host_tenant}-{host_lane}-{subdomain}') console.log(template(vars)) // Logs out "http://my.only.host.com-{host_tenant}-{host_lane}-my.only"
Can be reproduced here: https://runkit.com/58827adb4ddfcf0014890d06/58827adb4ddfcf0014890d07
The text was updated successfully, but these errors were encountered:
I believe this is fixed by changing this line: https://github.com/Matt-Esch/string-template/blob/master/compile.js#L4 to allow an _ in its charset, but you may want to support other valid characters in variable names such as $
_
$
Sorry, something went wrong.
No branches or pull requests
Using version 1.0.0 on node v6.9.4:
Can be reproduced here: https://runkit.com/58827adb4ddfcf0014890d06/58827adb4ddfcf0014890d07
The text was updated successfully, but these errors were encountered: