{"action":"opened","number":20,"pull_request":{"url":"https://api.github.com/repos/avoidwork/tiny-worker/pulls/20","id":141085602,"html_url":"https://github.com/avoidwork/tiny-worker/pull/20","diff_url":"https://github.com/avoidwork/tiny-worker/pull/20.diff","patch_url":"https://github.com/avoidwork/tiny-worker/pull/20.patch","issue_url":"https://api.github.com/repos/avoidwork/tiny-worker/issues/20","number":20,"state":"open","locked":false,"title":"Fix crash with minified functions","user":{"login":"danieleds","id":402652,"avatar_url":"https://avatars1.githubusercontent.com/u/402652?v=4","gravatar_id":"","url":"https://api.github.com/users/danieleds","html_url":"https://github.com/danieleds","followers_url":"https://api.github.com/users/danieleds/followers","following_url":"https://api.github.com/users/danieleds/following{/other_user}","gists_url":"https://api.github.com/users/danieleds/gists{/gist_id}","starred_url":"https://api.github.com/users/danieleds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danieleds/subscriptions","organizations_url":"https://api.github.com/users/danieleds/orgs","repos_url":"https://api.github.com/users/danieleds/repos","events_url":"https://api.github.com/users/danieleds/events{/privacy}","received_events_url":"https://api.github.com/users/danieleds/received_events","type":"User","site_admin":false},"body":"This is an example of a valid minified function that doesn't work with the regex in toFunction:\r\n\r\n    function profileModelWorkerRunner(){var Moment=eval(\"require\")(\"moment-timezone\");self.onmessage=function(event){var profileModelClass=eval(\"require\")(event.data.profileModelPath).default,profileModelWorker=new profileModelClass(Moment,event.data.timezone),params=event.data.params;var result=profileModelWorker.check(params);postMessage(result)}}\r\n\r\nI've replaced that code with an eval, which is safer than parsing JS code (which is not a context-free grammar) with regular expressions.","created_at":"2017-09-14T14:12:18Z","updated_at":"2017-09-14T14:12:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/avoidwork/tiny-worker/pulls/20/commits","review_comments_url":"https://api.github.com/repos/avoidwork/tiny-worker/pulls/20/comments","review_comment_url":"https://api.github.com/repos/avoidwork/tiny-worker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/avoidwork/tiny-worker/issues/20/comments","statuses_url":"https://api.github.com/repos/avoidwork/tiny-worker/statuses/70ce2ba0d64ac3f203174c845ef2e5e56aefaba2","head":{"label":"danieleds:patch-1","ref":"patch-1","sha":"70ce2ba0d64ac3f203174c845ef2e5e56aefaba2","user":{"login":"danieleds","id":402652,"avatar_url":"https://avatars1.githubusercontent.com/u/402652?v=4","gravatar_id":"","url":"https://api.github.com/users/danieleds","html_url":"https://github.com/danieleds","followers_url":"https://api.github.com/users/danieleds/followers","following_url":"https://api.github.com/users/danieleds/following{/other_user}","gists_url":"https://api.github.com/users/danieleds/gists{/gist_id}","starred_url":"https://api.github.com/users/danieleds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danieleds/subscriptions","organizations_url":"https://api.github.com/users/danieleds/orgs","repos_url":"https://api.github.com/users/danieleds/repos","events_url":"https://api.github.com/users/danieleds/events{/privacy}","received_events_url":"https://api.github.com/users/danieleds/received_events","type":"User","site_admin":false},"repo":{"id":70253468,"name":"tiny-worker","full_name":"danieleds/tiny-worker","owner":{"login":"danieleds","id":402652,"avatar_url":"https://avatars1.githubusercontent.com/u/402652?v=4","gravatar_id":"","url":"https://api.github.com/users/danieleds","html_url":"https://github.com/danieleds","followers_url":"https://api.github.com/users/danieleds/followers","following_url":"https://api.github.com/users/danieleds/following{/other_user}","gists_url":"https://api.github.com/users/danieleds/gists{/gist_id}","starred_url":"https://api.github.com/users/danieleds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danieleds/subscriptions","organizations_url":"https://api.github.com/users/danieleds/orgs","repos_url":"https://api.github.com/users/danieleds/repos","events_url":"https://api.github.com/users/danieleds/events{/privacy}","received_events_url":"https://api.github.com/users/danieleds/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/danieleds/tiny-worker","description":"Tiny WebWorker for the Server","fork":true,"url":"https://api.github.com/repos/danieleds/tiny-worker","forks_url":"https://api.github.com/repos/danieleds/tiny-worker/forks","keys_url":"https://api.github.com/repos/danieleds/tiny-worker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/danieleds/tiny-worker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/danieleds/tiny-worker/teams","hooks_url":"https://api.github.com/repos/danieleds/tiny-worker/hooks","issue_events_url":"https://api.github.com/repos/danieleds/tiny-worker/issues/events{/number}","events_url":"https://api.github.com/repos/danieleds/tiny-worker/events","assignees_url":"https://api.github.com/repos/danieleds/tiny-worker/assignees{/user}","branches_url":"https://api.github.com/repos/danieleds/tiny-worker/branches{/branch}","tags_url":"https://api.github.com/repos/danieleds/tiny-worker/tags","blobs_url":"https://api.github.com/repos/danieleds/tiny-worker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/danieleds/tiny-worker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/danieleds/tiny-worker/git/refs{/sha}","trees_url":"https://api.github.com/repos/danieleds/tiny-worker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/danieleds/tiny-worker/statuses/{sha}","languages_url":"https://api.github.com/repos/danieleds/tiny-worker/languages","stargazers_url":"https://api.github.com/repos/danieleds/tiny-worker/stargazers","contributors_url":"https://api.github.com/repos/danieleds/tiny-worker/contributors","subscribers_url":"https://api.github.com/repos/danieleds/tiny-worker/subscribers","subscription_url":"https://api.github.com/repos/danieleds/tiny-worker/subscription","commits_url":"https://api.github.com/repos/danieleds/tiny-worker/commits{/sha}","git_commits_url":"https://api.github.com/repos/danieleds/tiny-worker/git/commits{/sha}","comments_url":"https://api.github.com/repos/danieleds/tiny-worker/comments{/number}","issue_comment_url":"https://api.github.com/repos/danieleds/tiny-worker/issues/comments{/number}","contents_url":"https://api.github.com/repos/danieleds/tiny-worker/contents/{+path}","compare_url":"https://api.github.com/repos/danieleds/tiny-worker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/danieleds/tiny-worker/merges","archive_url":"https://api.github.com/repos/danieleds/tiny-worker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/danieleds/tiny-worker/downloads","issues_url":"https://api.github.com/repos/danieleds/tiny-worker/issues{/number}","pulls_url":"https://api.github.com/repos/danieleds/tiny-worker/pulls{/number}","milestones_url":"https://api.github.com/repos/danieleds/tiny-worker/milestones{/number}","notifications_url":"https://api.github.com/repos/danieleds/tiny-worker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/danieleds/tiny-worker/labels{/name}","releases_url":"https://api.github.com/repos/danieleds/tiny-worker/releases{/id}","deployments_url":"https://api.github.com/repos/danieleds/tiny-worker/deployments","created_at":"2016-10-07T14:19:26Z","updated_at":"2017-03-28T04:20:22Z","pushed_at":"2017-09-14T14:11:58Z","git_url":"git://github.com/danieleds/tiny-worker.git","ssh_url":"git@github.com:danieleds/tiny-worker.git","clone_url":"https://github.com/danieleds/tiny-worker.git","svn_url":"https://github.com/danieleds/tiny-worker","homepage":"http://avoidwork.github.io/tiny-worker","size":32,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"avoidwork:master","ref":"master","sha":"5818285980cd3228bc8e5d6dd0f8dc5b91787f99","user":{"login":"avoidwork","id":369698,"avatar_url":"https://avatars2.githubusercontent.com/u/369698?v=4","gravatar_id":"","url":"https://api.github.com/users/avoidwork","html_url":"https://github.com/avoidwork","followers_url":"https://api.github.com/users/avoidwork/followers","following_url":"https://api.github.com/users/avoidwork/following{/other_user}","gists_url":"https://api.github.com/users/avoidwork/gists{/gist_id}","starred_url":"https://api.github.com/users/avoidwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avoidwork/subscriptions","organizations_url":"https://api.github.com/users/avoidwork/orgs","repos_url":"https://api.github.com/users/avoidwork/repos","events_url":"https://api.github.com/users/avoidwork/events{/privacy}","received_events_url":"https://api.github.com/users/avoidwork/received_events","type":"User","site_admin":false},"repo":{"id":43386607,"name":"tiny-worker","full_name":"avoidwork/tiny-worker","owner":{"login":"avoidwork","id":369698,"avatar_url":"https://avatars2.githubusercontent.com/u/369698?v=4","gravatar_id":"","url":"https://api.github.com/users/avoidwork","html_url":"https://github.com/avoidwork","followers_url":"https://api.github.com/users/avoidwork/followers","following_url":"https://api.github.com/users/avoidwork/following{/other_user}","gists_url":"https://api.github.com/users/avoidwork/gists{/gist_id}","starred_url":"https://api.github.com/users/avoidwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avoidwork/subscriptions","organizations_url":"https://api.github.com/users/avoidwork/orgs","repos_url":"https://api.github.com/users/avoidwork/repos","events_url":"https://api.github.com/users/avoidwork/events{/privacy}","received_events_url":"https://api.github.com/users/avoidwork/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/avoidwork/tiny-worker","description":"Tiny WebWorker for the Server","fork":false,"url":"https://api.github.com/repos/avoidwork/tiny-worker","forks_url":"https://api.github.com/repos/avoidwork/tiny-worker/forks","keys_url":"https://api.github.com/repos/avoidwork/tiny-worker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/avoidwork/tiny-worker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/avoidwork/tiny-worker/teams","hooks_url":"https://api.github.com/repos/avoidwork/tiny-worker/hooks","issue_events_url":"https://api.github.com/repos/avoidwork/tiny-worker/issues/events{/number}","events_url":"https://api.github.com/repos/avoidwork/tiny-worker/events","assignees_url":"https://api.github.com/repos/avoidwork/tiny-worker/assignees{/user}","branches_url":"https://api.github.com/repos/avoidwork/tiny-worker/branches{/branch}","tags_url":"https://api.github.com/repos/avoidwork/tiny-worker/tags","blobs_url":"https://api.github.com/repos/avoidwork/tiny-worker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/avoidwork/tiny-worker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/avoidwork/tiny-worker/git/refs{/sha}","trees_url":"https://api.github.com/repos/avoidwork/tiny-worker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/avoidwork/tiny-worker/statuses/{sha}","languages_url":"https://api.github.com/repos/avoidwork/tiny-worker/languages","stargazers_url":"https://api.github.com/repos/avoidwork/tiny-worker/stargazers","contributors_url":"https://api.github.com/repos/avoidwork/tiny-worker/contributors","subscribers_url":"https://api.github.com/repos/avoidwork/tiny-worker/subscribers","subscription_url":"https://api.github.com/repos/avoidwork/tiny-worker/subscription","commits_url":"https://api.github.com/repos/avoidwork/tiny-worker/commits{/sha}","git_commits_url":"https://api.github.com/repos/avoidwork/tiny-worker/git/commits{/sha}","comments_url":"https://api.github.com/repos/avoidwork/tiny-worker/comments{/number}","issue_comment_url":"https://api.github.com/repos/avoidwork/tiny-worker/issues/comments{/number}","contents_url":"https://api.github.com/repos/avoidwork/tiny-worker/contents/{+path}","compare_url":"https://api.github.com/repos/avoidwork/tiny-worker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/avoidwork/tiny-worker/merges","archive_url":"https://api.github.com/repos/avoidwork/tiny-worker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/avoidwork/tiny-worker/downloads","issues_url":"https://api.github.com/repos/avoidwork/tiny-worker/issues{/number}","pulls_url":"https://api.github.com/repos/avoidwork/tiny-worker/pulls{/number}","milestones_url":"https://api.github.com/repos/avoidwork/tiny-worker/milestones{/number}","notifications_url":"https://api.github.com/repos/avoidwork/tiny-worker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/avoidwork/tiny-worker/labels{/name}","releases_url":"https://api.github.com/repos/avoidwork/tiny-worker/releases{/id}","deployments_url":"https://api.github.com/repos/avoidwork/tiny-worker/deployments","created_at":"2015-09-29T18:35:00Z","updated_at":"2017-09-06T11:21:16Z","pushed_at":"2017-05-04T12:06:48Z","git_url":"git://github.com/avoidwork/tiny-worker.git","ssh_url":"git@github.com:avoidwork/tiny-worker.git","clone_url":"https://github.com/avoidwork/tiny-worker.git","svn_url":"https://github.com/avoidwork/tiny-worker","homepage":"http://avoidwork.github.io/tiny-worker","size":50,"stargazers_count":59,"watchers_count":59,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":7,"mirror_url":null,"open_issues_count":3,"forks":7,"open_issues":3,"watchers":59,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/avoidwork/tiny-worker/pulls/20"},"html":{"href":"https://github.com/avoidwork/tiny-worker/pull/20"},"issue":{"href":"https://api.github.com/repos/avoidwork/tiny-worker/issues/20"},"comments":{"href":"https://api.github.com/repos/avoidwork/tiny-worker/issues/20/comments"},"review_comments":{"href":"https://api.github.com/repos/avoidwork/tiny-worker/pulls/20/comments"},"review_comment":{"href":"https://api.github.com/repos/avoidwork/tiny-worker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/avoidwork/tiny-worker/pulls/20/commits"},"statuses":{"href":"https://api.github.com/repos/avoidwork/tiny-worker/statuses/70ce2ba0d64ac3f203174c845ef2e5e56aefaba2"}},"author_association":"NONE","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":1,"additions":3,"deletions":3,"changed_files":1}}
{"actor":{"display_login":"danieleds"}}