string-template icon indicating copy to clipboard operation
string-template copied to clipboard

adding dot when parsing string templates

Open botverse opened this issue 8 years ago • 2 comments

This is useful to be able to pass flattened objects to the template.

So you can do:

var user = { user: { name: 'Mark' }};
var flatUser = flatten(user); // => { "user.name": "Mark" }
var string = format('Hello {user.name}', flatUser);

botverse avatar Mar 17 '17 13:03 botverse

Coverage Status

Coverage remained the same at 100.0% when pulling ee257522aaa55467a67a04d9b4ceae80ae3b4066 on botverse:master into f63e51a5b60e98e5be1ed07da20332d415482edb on Matt-Esch:master.

coveralls avatar Mar 17 '17 13:03 coveralls

Probably should also add "." to string-template/compile.js

lslalbai avatar Nov 22 '21 14:11 lslalbai