-
Notifications
You must be signed in to change notification settings - Fork 47
Open
Description
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
Vontus
Metadata
Metadata
Assignees
Labels
No labels