{"action":"created","issue":{"url":"https://api.github.com/repos/yahoo/serialize-javascript/issues/20","repository_url":"https://api.github.com/repos/yahoo/serialize-javascript","labels_url":"https://api.github.com/repos/yahoo/serialize-javascript/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/yahoo/serialize-javascript/issues/20/comments","events_url":"https://api.github.com/repos/yahoo/serialize-javascript/issues/20/events","html_url":"https://github.com/yahoo/serialize-javascript/issues/20","id":174296417,"number":20,"title":"Deserialize support?","user":{"login":"nicojs","id":1828233,"avatar_url":"https://avatars.githubusercontent.com/u/1828233?v=3","gravatar_id":"","url":"https://api.github.com/users/nicojs","html_url":"https://github.com/nicojs","followers_url":"https://api.github.com/users/nicojs/followers","following_url":"https://api.github.com/users/nicojs/following{/other_user}","gists_url":"https://api.github.com/users/nicojs/gists{/gist_id}","starred_url":"https://api.github.com/users/nicojs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicojs/subscriptions","organizations_url":"https://api.github.com/users/nicojs/orgs","repos_url":"https://api.github.com/users/nicojs/repos","events_url":"https://api.github.com/users/nicojs/events{/privacy}","received_events_url":"https://api.github.com/users/nicojs/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-31T14:58:50Z","updated_at":"2016-09-01T04:48:10Z","closed_at":null,"body":"How would one go about deserializing a serialized string? I want to use this library to serialize objects that might contain regex's and pass them on to a child process using `childProcess.send`. Therefore i need to deserialize on the other end.\r\n\r\nIs this a use case that this library should support? Or is that something that should be done somewhere else?\r\n\r\nI guess i could use something like this:\r\n\r\n```javascript\r\nfunction deserialize(serializedData){\r\n  require('vm').runInThisContext('var a = ' + serializedData);\r\n  return a;\r\n}\r\n```\r\n\r\nBut i don't think its elegant.\r\n\r\nThanks in advance!"},"comment":{"url":"https://api.github.com/repos/yahoo/serialize-javascript/issues/comments/243975106","html_url":"https://github.com/yahoo/serialize-javascript/issues/20#issuecomment-243975106","issue_url":"https://api.github.com/repos/yahoo/serialize-javascript/issues/20","id":243975106,"user":{"login":"nicojs","id":1828233,"avatar_url":"https://avatars.githubusercontent.com/u/1828233?v=3","gravatar_id":"","url":"https://api.github.com/users/nicojs","html_url":"https://github.com/nicojs","followers_url":"https://api.github.com/users/nicojs/followers","following_url":"https://api.github.com/users/nicojs/following{/other_user}","gists_url":"https://api.github.com/users/nicojs/gists{/gist_id}","starred_url":"https://api.github.com/users/nicojs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicojs/subscriptions","organizations_url":"https://api.github.com/users/nicojs/orgs","repos_url":"https://api.github.com/users/nicojs/repos","events_url":"https://api.github.com/users/nicojs/events{/privacy}","received_events_url":"https://api.github.com/users/nicojs/received_events","type":"User","site_admin":false},"created_at":"2016-09-01T04:48:09Z","updated_at":"2016-09-01T04:48:09Z","body":"Ah yes i just found it.\r\n\r\n```javascript\r\nvar a  = eval('(' + text + ')');\r\n```\r\n\r\nI forgot the parentheses at first. If you do that, eval will see `{` as the start of a code block. \r\n\r\nI will close this issue. Maybe it would be valuable to add an example piece of code to the readme file."}}
{"actor":{"display_login":"nicojs"}}