What is the best method to transform the string...
"{ name: 'John' }"
...into a valid JavaScript object literal so I can retrieve data using its keys (e.g. varname["name"] == "John")? JSON.parse() cannot be used because the string is not in valid JSON format.