serge-community / serge

Continuous localization platform
https://serge.io/
Other
237 stars 53 forks source link

parse_js: add support for single-quoted keys and values #118

Closed iafan closed 5 years ago

iafan commented 5 years ago

Right now parse_js parser can work only with double quotes surrounding keys and values:

"foo": "bar"

For robustness, it needs to also support single quotes for keys and values, and combinations thereof. All lines below should also be valid:

'foo1': 'bar1'
"foo2": 'bar2'
'foo3': "bar3"

And while we're at this, having keys with no quotes should also be supported:

foo4: 'bar4'
foo5: "bar5"