sprintf.js
sprintf.js copied to clipboard
Named arguments, where the key is not a single word
Is there any way to deal with named arguments, where the key is not a single word, like this case:
var user = {
"First Name": "Dolly"
}
sprintf("Hello %(First Name)s", user) // Hello Dolly
(the above code produces an error)
Yeah, I think that's doable
Unfortunately I don't have time right now. I'll see if I can do it at the end of the week
At a first glance, this should be easy to fix. I think the placeholder parser consumes everything but a ) but then when it checks whether it's a key, it uses a different regexp that matches alnum characters
Note to self: see also #104