jonschlinkert / expand

Recursively resolve templates in an object, string or array.
MIT License
8 stars 3 forks source link

camelcase keys #1

Open jonschlinkert opened 8 years ago

jonschlinkert commented 8 years ago

new Function() will try to convert JSON keys to plain object keys, in which case keys with a - will create an eval syntax error. this sucks but it is what it is... we need to do something to provide a better error message for [SyntaxError: Unexpected token -]

doowb commented 8 years ago

Should this be in engine or do you want to handle it here to prevent passing along the keys to engine?

jonschlinkert commented 8 years ago

they keys wouldn't make it to engine. it's done here in interpolate. seems like keys should be valid with dashes when they're stringified. I need to double check