{"action":"created","comment":{"url":"https://api.github.com/repos/danthareja/contribute-to-open-source/pulls/comments/225253240","pull_request_review_id":164815555,"id":225253240,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNTI1MzI0MA==","diff_hunk":"@@ -1,47 +1,33 @@\n-exports._check = () => {\n-  // DRY up the codebase with this function\n-  // First, move the duplicate error checking code here\n-  // Then, invoke this function inside each of the others\n-  // HINT: you can invoke this function with exports._check()\n-};\n-\n-exports.add = (x, y) => {\n+exports._check = (x, y) => {\n   if (typeof x !== 'number') {\n     throw new TypeError(`${x} is not a number`);\n   }\n   if (typeof y !== 'number') {\n     throw new TypeError(`${y} is not a number`);\n   }\n+};\n+\n+exports.add = (x, y) => {\n+  exports._check(x, y);\n+  \n   return x + y;\n };\n \n exports.subtract = (x, y) => {\n-  if (typeof x !== 'number') {\n-    throw new TypeError(`${x} is not a number`);\n-  }\n-  if (typeof y !== 'number') {\n-    throw new TypeError(`${y} is not a number`);\n-  }\n+  exports._check(x, y);\n+  \n   return x - y;\n };\n \n exports.multiply = (x, y) => {\n-  if (typeof x !== 'number') {\n-    throw new TypeError(`${x} is not a number`);\n-  }\n-  if (typeof y !== 'number') {\n-    throw new TypeError(`${y} is not a number`);\n-  }\n+  exports._check(x, y);\n+  \n   return x * y;\n };\n \n exports.divide = (x, y) => {\n-  if (typeof x !== 'number') {\n-    throw new TypeError(`${x} is not a number`);\n-  }\n-  if (typeof y !== 'number') {\n-    throw new TypeError(`${y} is not a number`);\n-  }\n+  exports._check(x, y);\n+  ","path":"src/calculator.js","position":56,"original_position":56,"commit_id":"a45d2eb9ad729601f440c163ad21996598ede04e","original_commit_id":"a45d2eb9ad729601f440c163ad21996598ede04e","user":{"login":"dantharejabot","id":28961555,"node_id":"MDQ6VXNlcjI4OTYxNTU1","avatar_url":"https://avatars0.githubusercontent.com/u/28961555?v=4","gravatar_id":"","url":"https://api.github.com/users/dantharejabot","html_url":"https://github.com/dantharejabot","followers_url":"https://api.github.com/users/dantharejabot/followers","following_url":"https://api.github.com/users/dantharejabot/following{/other_user}","gists_url":"https://api.github.com/users/dantharejabot/gists{/gist_id}","starred_url":"https://api.github.com/users/dantharejabot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dantharejabot/subscriptions","organizations_url":"https://api.github.com/users/dantharejabot/orgs","repos_url":"https://api.github.com/users/dantharejabot/repos","events_url":"https://api.github.com/users/dantharejabot/events{/privacy}","received_events_url":"https://api.github.com/users/dantharejabot/received_events","type":"User","site_admin":false},"body":"Trailing spaces not allowed.\n\n###### See http://eslint.org/docs/rules/no-trailing-spaces for details about this rule\n","created_at":"2018-10-15T17:33:24Z","updated_at":"2018-10-15T17:33:24Z","html_url":"https://github.com/danthareja/contribute-to-open-source/pull/305#discussion_r225253240","pull_request_url":"https://api.github.com/repos/danthareja/contribute-to-open-source/pulls/305","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/danthareja/contribute-to-open-source/pulls/comments/225253240"},"html":{"href":"https://github.com/danthareja/contribute-to-open-source/pull/305#discussion_r225253240"},"pull_request":{"href":"https://api.github.com/repos/danthareja/contribute-to-open-source/pulls/305"}}},"pull_request":{"url":"https://api.github.com/repos/danthareja/contribute-to-open-source/pulls/305","id":222985275,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIyOTg1Mjc1","html_url":"https://github.com/danthareja/contribute-to-open-source/pull/305","diff_url":"https://github.com/danthareja/contribute-to-open-source/pull/305.diff","patch_url":"https://github.com/danthareja/contribute-to-open-source/pull/305.patch","issue_url":"https://api.github.com/repos/danthareja/contribute-to-open-source/issues/305","number":305,"state":"open","locked":false,"title":"Implemented _check and removed superfluous error checking","user":{"login":"drkohlipk","id":19544376,"node_id":"MDQ6VXNlcjE5NTQ0Mzc2","avatar_url":"https://avatars1.githubusercontent.com/u/19544376?v=4","gravatar_id":"","url":"https://api.github.com/users/drkohlipk","html_url":"https://github.com/drkohlipk","followers_url":"https://api.github.com/users/drkohlipk/followers","following_url":"https://api.github.com/users/drkohlipk/following{/other_user}","gists_url":"https://api.github.com/users/drkohlipk/gists{/gist_id}","starred_url":"https://api.github.com/users/drkohlipk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drkohlipk/subscriptions","organizations_url":"https://api.github.com/users/drkohlipk/orgs","repos_url":"https://api.github.com/users/drkohlipk/repos","events_url":"https://api.github.com/users/drkohlipk/events{/privacy}","received_events_url":"https://api.github.com/users/drkohlipk/received_events","type":"User","site_admin":false},"body":"- Implemented `calculator._check` with type checking for `x` and `y` to ensure they are both of type number.\r\nRemoved the superfluous error checking in each of the calculator functions and replaced it with calls to `exports._check`.\r\nUpdated the first `describe` in `calculator.test.js` to run instead of being skipped.","created_at":"2018-10-15T17:33:12Z","updated_at":"2018-10-15T17:33:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"af7ab00c64dbb2efb638b0f5682fc738529e2b2d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/danthareja/contribute-to-open-source/pulls/305/commits","review_comments_url":"https://api.github.com/repos/danthareja/contribute-to-open-source/pulls/305/comments","review_comment_url":"https://api.github.com/repos/danthareja/contribute-to-open-source/pulls/comments{/number}","comments_url":"https://api.github.com/repos/danthareja/contribute-to-open-source/issues/305/comments","statuses_url":"https://api.github.com/repos/danthareja/contribute-to-open-source/statuses/a45d2eb9ad729601f440c163ad21996598ede04e","head":{"label":"drkohlipk:master","ref":"master","sha":"a45d2eb9ad729601f440c163ad21996598ede04e","user":{"login":"drkohlipk","id":19544376,"node_id":"MDQ6VXNlcjE5NTQ0Mzc2","avatar_url":"https://avatars1.githubusercontent.com/u/19544376?v=4","gravatar_id":"","url":"https://api.github.com/users/drkohlipk","html_url":"https://github.com/drkohlipk","followers_url":"https://api.github.com/users/drkohlipk/followers","following_url":"https://api.github.com/users/drkohlipk/following{/other_user}","gists_url":"https://api.github.com/users/drkohlipk/gists{/gist_id}","starred_url":"https://api.github.com/users/drkohlipk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drkohlipk/subscriptions","organizations_url":"https://api.github.com/users/drkohlipk/orgs","repos_url":"https://api.github.com/users/drkohlipk/repos","events_url":"https://api.github.com/users/drkohlipk/events{/privacy}","received_events_url":"https://api.github.com/users/drkohlipk/received_events","type":"User","site_admin":false},"repo":{"id":153149137,"node_id":"MDEwOlJlcG9zaXRvcnkxNTMxNDkxMzc=","name":"contribute-to-open-source","full_name":"drkohlipk/contribute-to-open-source","private":false,"owner":{"login":"drkohlipk","id":19544376,"node_id":"MDQ6VXNlcjE5NTQ0Mzc2","avatar_url":"https://avatars1.githubusercontent.com/u/19544376?v=4","gravatar_id":"","url":"https://api.github.com/users/drkohlipk","html_url":"https://github.com/drkohlipk","followers_url":"https://api.github.com/users/drkohlipk/followers","following_url":"https://api.github.com/users/drkohlipk/following{/other_user}","gists_url":"https://api.github.com/users/drkohlipk/gists{/gist_id}","starred_url":"https://api.github.com/users/drkohlipk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drkohlipk/subscriptions","organizations_url":"https://api.github.com/users/drkohlipk/orgs","repos_url":"https://api.github.com/users/drkohlipk/repos","events_url":"https://api.github.com/users/drkohlipk/events{/privacy}","received_events_url":"https://api.github.com/users/drkohlipk/received_events","type":"User","site_admin":false},"html_url":"https://github.com/drkohlipk/contribute-to-open-source","description":"Learn the GitHub workflow by contributing code in a fun simulation project ","fork":true,"url":"https://api.github.com/repos/drkohlipk/contribute-to-open-source","forks_url":"https://api.github.com/repos/drkohlipk/contribute-to-open-source/forks","keys_url":"https://api.github.com/repos/drkohlipk/contribute-to-open-source/keys{/key_id}","collaborators_url":"https://api.github.com/repos/drkohlipk/contribute-to-open-source/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/drkohlipk/contribute-to-open-source/teams","hooks_url":"https://api.github.com/repos/drkohlipk/contribute-to-open-source/hooks","issue_events_url":"https://api.github.com/repos/drkohlipk/contribute-to-open-source/issues/events{/number}","events_url":"https://api.github.com/repos/drkohlipk/contribute-to-open-source/events","assignees_url":"https://api.github.com/repos/drkohlipk/contribute-to-open-source/assignees{/user}","branches_url":"https://api.github.com/repos/drkohlipk/contribute-to-open-source/branches{/branch}","tags_url":"https://api.github.com/repos/drkohlipk/contribute-to-open-source/tags","blobs_url":"https://api.github.com/repos/drkohlipk/contribute-to-open-source/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/drkohlipk/contribute-to-open-source/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/drkohlipk/contribute-to-open-source/git/refs{/sha}","trees_url":"https://api.github.com/repos/drkohlipk/contribute-to-open-source/git/trees{/sha}","statuses_url":"https://api.github.com/repos/drkohlipk/contribute-to-open-source/statuses/{sha}","languages_url":"https://api.github.com/repos/drkohlipk/contribute-to-open-source/languages","stargazers_url":"https://api.github.com/repos/drkohlipk/contribute-to-open-source/stargazers","contributors_url":"https://api.github.com/repos/drkohlipk/contribute-to-open-source/contributors","subscribers_url":"https://api.github.com/repos/drkohlipk/contribute-to-open-source/subscribers","subscription_url":"https://api.github.com/repos/drkohlipk/contribute-to-open-source/subscription","commits_url":"https://api.github.com/repos/drkohlipk/contribute-to-open-source/commits{/sha}","git_commits_url":"https://api.github.com/repos/drkohlipk/contribute-to-open-source/git/commits{/sha}","comments_url":"https://api.github.com/repos/drkohlipk/contribute-to-open-source/comments{/number}","issue_comment_url":"https://api.github.com/repos/drkohlipk/contribute-to-open-source/issues/comments{/number}","contents_url":"https://api.github.com/repos/drkohlipk/contribute-to-open-source/contents/{+path}","compare_url":"https://api.github.com/repos/drkohlipk/contribute-to-open-source/compare/{base}...{head}","merges_url":"https://api.github.com/repos/drkohlipk/contribute-to-open-source/merges","archive_url":"https://api.github.com/repos/drkohlipk/contribute-to-open-source/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/drkohlipk/contribute-to-open-source/downloads","issues_url":"https://api.github.com/repos/drkohlipk/contribute-to-open-source/issues{/number}","pulls_url":"https://api.github.com/repos/drkohlipk/contribute-to-open-source/pulls{/number}","milestones_url":"https://api.github.com/repos/drkohlipk/contribute-to-open-source/milestones{/number}","notifications_url":"https://api.github.com/repos/drkohlipk/contribute-to-open-source/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/drkohlipk/contribute-to-open-source/labels{/name}","releases_url":"https://api.github.com/repos/drkohlipk/contribute-to-open-source/releases{/id}","deployments_url":"https://api.github.com/repos/drkohlipk/contribute-to-open-source/deployments","created_at":"2018-10-15T16:49:10Z","updated_at":"2018-10-15T17:26:16Z","pushed_at":"2018-10-15T17:26:15Z","git_url":"git://github.com/drkohlipk/contribute-to-open-source.git","ssh_url":"git@github.com:drkohlipk/contribute-to-open-source.git","clone_url":"https://github.com/drkohlipk/contribute-to-open-source.git","svn_url":"https://github.com/drkohlipk/contribute-to-open-source","homepage":"","size":39,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"danthareja:drkohlipk","ref":"drkohlipk","sha":"8c115bb2d00718f7e248271c14c2e87fecc71035","user":{"login":"danthareja","id":6980359,"node_id":"MDQ6VXNlcjY5ODAzNTk=","avatar_url":"https://avatars1.githubusercontent.com/u/6980359?v=4","gravatar_id":"","url":"https://api.github.com/users/danthareja","html_url":"https://github.com/danthareja","followers_url":"https://api.github.com/users/danthareja/followers","following_url":"https://api.github.com/users/danthareja/following{/other_user}","gists_url":"https://api.github.com/users/danthareja/gists{/gist_id}","starred_url":"https://api.github.com/users/danthareja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danthareja/subscriptions","organizations_url":"https://api.github.com/users/danthareja/orgs","repos_url":"https://api.github.com/users/danthareja/repos","events_url":"https://api.github.com/users/danthareja/events{/privacy}","received_events_url":"https://api.github.com/users/danthareja/received_events","type":"User","site_admin":false},"repo":{"id":109887187,"node_id":"MDEwOlJlcG9zaXRvcnkxMDk4ODcxODc=","name":"contribute-to-open-source","full_name":"danthareja/contribute-to-open-source","private":false,"owner":{"login":"danthareja","id":6980359,"node_id":"MDQ6VXNlcjY5ODAzNTk=","avatar_url":"https://avatars1.githubusercontent.com/u/6980359?v=4","gravatar_id":"","url":"https://api.github.com/users/danthareja","html_url":"https://github.com/danthareja","followers_url":"https://api.github.com/users/danthareja/followers","following_url":"https://api.github.com/users/danthareja/following{/other_user}","gists_url":"https://api.github.com/users/danthareja/gists{/gist_id}","starred_url":"https://api.github.com/users/danthareja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danthareja/subscriptions","organizations_url":"https://api.github.com/users/danthareja/orgs","repos_url":"https://api.github.com/users/danthareja/repos","events_url":"https://api.github.com/users/danthareja/events{/privacy}","received_events_url":"https://api.github.com/users/danthareja/received_events","type":"User","site_admin":false},"html_url":"https://github.com/danthareja/contribute-to-open-source","description":"Learn the GitHub workflow by contributing code in a fun simulation project ","fork":false,"url":"https://api.github.com/repos/danthareja/contribute-to-open-source","forks_url":"https://api.github.com/repos/danthareja/contribute-to-open-source/forks","keys_url":"https://api.github.com/repos/danthareja/contribute-to-open-source/keys{/key_id}","collaborators_url":"https://api.github.com/repos/danthareja/contribute-to-open-source/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/danthareja/contribute-to-open-source/teams","hooks_url":"https://api.github.com/repos/danthareja/contribute-to-open-source/hooks","issue_events_url":"https://api.github.com/repos/danthareja/contribute-to-open-source/issues/events{/number}","events_url":"https://api.github.com/repos/danthareja/contribute-to-open-source/events","assignees_url":"https://api.github.com/repos/danthareja/contribute-to-open-source/assignees{/user}","branches_url":"https://api.github.com/repos/danthareja/contribute-to-open-source/branches{/branch}","tags_url":"https://api.github.com/repos/danthareja/contribute-to-open-source/tags","blobs_url":"https://api.github.com/repos/danthareja/contribute-to-open-source/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/danthareja/contribute-to-open-source/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/danthareja/contribute-to-open-source/git/refs{/sha}","trees_url":"https://api.github.com/repos/danthareja/contribute-to-open-source/git/trees{/sha}","statuses_url":"https://api.github.com/repos/danthareja/contribute-to-open-source/statuses/{sha}","languages_url":"https://api.github.com/repos/danthareja/contribute-to-open-source/languages","stargazers_url":"https://api.github.com/repos/danthareja/contribute-to-open-source/stargazers","contributors_url":"https://api.github.com/repos/danthareja/contribute-to-open-source/contributors","subscribers_url":"https://api.github.com/repos/danthareja/contribute-to-open-source/subscribers","subscription_url":"https://api.github.com/repos/danthareja/contribute-to-open-source/subscription","commits_url":"https://api.github.com/repos/danthareja/contribute-to-open-source/commits{/sha}","git_commits_url":"https://api.github.com/repos/danthareja/contribute-to-open-source/git/commits{/sha}","comments_url":"https://api.github.com/repos/danthareja/contribute-to-open-source/comments{/number}","issue_comment_url":"https://api.github.com/repos/danthareja/contribute-to-open-source/issues/comments{/number}","contents_url":"https://api.github.com/repos/danthareja/contribute-to-open-source/contents/{+path}","compare_url":"https://api.github.com/repos/danthareja/contribute-to-open-source/compare/{base}...{head}","merges_url":"https://api.github.com/repos/danthareja/contribute-to-open-source/merges","archive_url":"https://api.github.com/repos/danthareja/contribute-to-open-source/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/danthareja/contribute-to-open-source/downloads","issues_url":"https://api.github.com/repos/danthareja/contribute-to-open-source/issues{/number}","pulls_url":"https://api.github.com/repos/danthareja/contribute-to-open-source/pulls{/number}","milestones_url":"https://api.github.com/repos/danthareja/contribute-to-open-source/milestones{/number}","notifications_url":"https://api.github.com/repos/danthareja/contribute-to-open-source/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/danthareja/contribute-to-open-source/labels{/name}","releases_url":"https://api.github.com/repos/danthareja/contribute-to-open-source/releases{/id}","deployments_url":"https://api.github.com/repos/danthareja/contribute-to-open-source/deployments","created_at":"2017-11-07T20:27:58Z","updated_at":"2018-10-14T22:43:58Z","pushed_at":"2018-10-15T17:33:12Z","git_url":"git://github.com/danthareja/contribute-to-open-source.git","ssh_url":"git@github.com:danthareja/contribute-to-open-source.git","clone_url":"https://github.com/danthareja/contribute-to-open-source.git","svn_url":"https://github.com/danthareja/contribute-to-open-source","homepage":"","size":39,"stargazers_count":231,"watchers_count":231,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":303,"mirror_url":null,"archived":false,"open_issues_count":29,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":303,"open_issues":29,"watchers":231,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/danthareja/contribute-to-open-source/pulls/305"},"html":{"href":"https://github.com/danthareja/contribute-to-open-source/pull/305"},"issue":{"href":"https://api.github.com/repos/danthareja/contribute-to-open-source/issues/305"},"comments":{"href":"https://api.github.com/repos/danthareja/contribute-to-open-source/issues/305/comments"},"review_comments":{"href":"https://api.github.com/repos/danthareja/contribute-to-open-source/pulls/305/comments"},"review_comment":{"href":"https://api.github.com/repos/danthareja/contribute-to-open-source/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/danthareja/contribute-to-open-source/pulls/305/commits"},"statuses":{"href":"https://api.github.com/repos/danthareja/contribute-to-open-source/statuses/a45d2eb9ad729601f440c163ad21996598ede04e"}},"author_association":"NONE"}}
{"actor":{"display_login":"dantharejabot"}}