Q:

Converting string to object with Javascript (Error: Unexpected token t in JSON at position 1)

I'm using Editor.js which outputs data as JSON and save that as String in DynamoDB. When I query that data, I want to convert that back to an Object.
Converting the string with JSON.parse() gives me Error: Unexpected token t in JSON at position 1 message.
var json = '{time=1558311121067, blocks=[{type=paragraph, data={text=writing something first}}], version=2.13.0}';
obj = JSON.parse(json);

Not sure what this error message means.

A:

I will suggest to correct the JSON from the origin itself if you can,
if you can't than you need to replace = with : and than stringify and parse 
({[^=]+|,[^=]+)=
   |       |_________ Replaces `=` which is preceded by `,`
   |_________________ Replaces `=` which is preceded by `{`

let json = '{time=1558311121067, blocks=[{type=paragraph, data={text=writing something first}}], version=2.13.0}';
json = json.replace(/({[^=]+|,[^=]+)=/g,"$1"+':')
let obj = JSON.parse(JSON.stringify(json));

console.log(obj)

On side note:- This is code is considering above given example data, it can be updated based on the kind of values your JSON can have

