Background
I have a string containing a javascript object. This string is not JSON stringified ( only a portion of it is ).
I need to convert this string into an object so than I can use it.
Here is an example of such string:
`{method: 'POST', url: '/iot/pipe/', query: {}, body: { d: '{"n": "861359031087669", "b": 100, "v": "02.37", "t": 1, "d":[[1515070895,413973366,21717600,110,1,0],[1515070897,413975033,21719083,102,1,0]]}' }, headers: { host: 'node_session_iot', connection: 'close', 'content-length': '1219', accept: '*/*', 'user-agent': 'QUECTEL_MODULE', 'content-type': 'application/x-www-form-urlencoded' } }`
JSON.parse
The string is not json stringified, so parse will fail.
eval
eval is evil. Never use it.
Solutions?
I find it incredibly frustrating. I have the object right in front of me and I can't do a single thing with it. What other options do I have to convert this string into an object?

evilit. Preferably you could go back and not produce such strings in the first place.". Fixing.