davidchambers / string-format

JavaScript string formatting inspired by Python’s `str.format()`

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support named arguments with spaces and special characters

makenoteshere opened this issue · comments

Hi, davidchambers,
Can named arguments, object keys with spaces ('avg val') or special characters (#, _ etc) be supported?

var user = {name: "Dolly", age: 24, 'in co': 23, '#':1}
undefined
"{name} - {age}".format(user)
"Dolly - 24"
"{name} - {age} - {in co}".format(user)
"Dolly - 24 - {in co}"
"{name} - {age} - {#}".format(user)
"Dolly - 24 - {#}"

This is supported in the mini-language branch. One of these days I should merge #2!

Look forward to it. Thanks.

Hi, Awesome work!

One of these days I should merge #2!

There ware quite long days, could you merge it?
Python format mini-language in JS – its incredible!