{"action":"created","comment":{"url":"https://api.github.com/repos/jreina/ShittyLINQ.js/pulls/comments/223182644","pull_request_review_id":162257266,"id":223182644,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMzE4MjY0NA==","diff_hunk":"@@ -0,0 +1,34 @@\n+/**\n+ * @template T\n+ * @param {((x: T) => boolean)} predicate\n+ * @returns {Any<T>}\n+ */\n+function Single (predicate) {\n+  const output = []\n+\n+  if (!predicate) {\n+    throw 'Source or predicate is null'","path":"src/Single.js","position":10,"original_position":10,"commit_id":"3950ef90dd1ed2e928b3eae1924305f91e1ab4ba","original_commit_id":"3950ef90dd1ed2e928b3eae1924305f91e1ab4ba","user":{"login":"jreina","id":2089820,"node_id":"MDQ6VXNlcjIwODk4MjA=","avatar_url":"https://avatars1.githubusercontent.com/u/2089820?v=4","gravatar_id":"","url":"https://api.github.com/users/jreina","html_url":"https://github.com/jreina","followers_url":"https://api.github.com/users/jreina/followers","following_url":"https://api.github.com/users/jreina/following{/other_user}","gists_url":"https://api.github.com/users/jreina/gists{/gist_id}","starred_url":"https://api.github.com/users/jreina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jreina/subscriptions","organizations_url":"https://api.github.com/users/jreina/orgs","repos_url":"https://api.github.com/users/jreina/repos","events_url":"https://api.github.com/users/jreina/events{/privacy}","received_events_url":"https://api.github.com/users/jreina/received_events","type":"User","site_admin":false},"body":"This method has an overload which does not require a predicate. We can merge as-is but would need to keep this issue open to allow someone to implement the overload here.","created_at":"2018-10-06T13:43:07Z","updated_at":"2018-10-06T13:44:24Z","html_url":"https://github.com/jreina/ShittyLINQ.js/pull/45#discussion_r223182644","pull_request_url":"https://api.github.com/repos/jreina/ShittyLINQ.js/pulls/45","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/jreina/ShittyLINQ.js/pulls/comments/223182644"},"html":{"href":"https://github.com/jreina/ShittyLINQ.js/pull/45#discussion_r223182644"},"pull_request":{"href":"https://api.github.com/repos/jreina/ShittyLINQ.js/pulls/45"}}},"pull_request":{"url":"https://api.github.com/repos/jreina/ShittyLINQ.js/pulls/45","id":220250280,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIwMjUwMjgw","html_url":"https://github.com/jreina/ShittyLINQ.js/pull/45","diff_url":"https://github.com/jreina/ShittyLINQ.js/pull/45.diff","patch_url":"https://github.com/jreina/ShittyLINQ.js/pull/45.patch","issue_url":"https://api.github.com/repos/jreina/ShittyLINQ.js/issues/45","number":45,"state":"open","locked":false,"title":"Add 'Single' method","user":{"login":"bencoullie","id":6733407,"node_id":"MDQ6VXNlcjY3MzM0MDc=","avatar_url":"https://avatars0.githubusercontent.com/u/6733407?v=4","gravatar_id":"","url":"https://api.github.com/users/bencoullie","html_url":"https://github.com/bencoullie","followers_url":"https://api.github.com/users/bencoullie/followers","following_url":"https://api.github.com/users/bencoullie/following{/other_user}","gists_url":"https://api.github.com/users/bencoullie/gists{/gist_id}","starred_url":"https://api.github.com/users/bencoullie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bencoullie/subscriptions","organizations_url":"https://api.github.com/users/bencoullie/orgs","repos_url":"https://api.github.com/users/bencoullie/repos","events_url":"https://api.github.com/users/bencoullie/events{/privacy}","received_events_url":"https://api.github.com/users/bencoullie/received_events","type":"User","site_admin":false},"body":"Relates to https://github.com/jreina/ShittyLINQ.js/issues/23 🙂 \r\n\r\nFeel free to request changes - I tried to keep it in the same vein as your other methods.\r\n\r\nI also tried to keep the exceptions to the same responses the actual `Single` method would return. Not sure if we want actual exceptions though... might make the function unusable as when they try it in a live scenario where the array length is variable then it will randomly throw exceptions.\r\n\r\nHappy to change this to return nothing if conditions aren't met and simply console a warning (or remove the exceptions that depend on a variable array length altogether).","created_at":"2018-10-04T05:02:05Z","updated_at":"2018-10-06T13:44:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d151b0f011f5873ac2a568a452a03b4496a5cb96","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/jreina/ShittyLINQ.js/pulls/45/commits","review_comments_url":"https://api.github.com/repos/jreina/ShittyLINQ.js/pulls/45/comments","review_comment_url":"https://api.github.com/repos/jreina/ShittyLINQ.js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jreina/ShittyLINQ.js/issues/45/comments","statuses_url":"https://api.github.com/repos/jreina/ShittyLINQ.js/statuses/3950ef90dd1ed2e928b3eae1924305f91e1ab4ba","head":{"label":"bencoullie:add-single-method","ref":"add-single-method","sha":"3950ef90dd1ed2e928b3eae1924305f91e1ab4ba","user":{"login":"bencoullie","id":6733407,"node_id":"MDQ6VXNlcjY3MzM0MDc=","avatar_url":"https://avatars0.githubusercontent.com/u/6733407?v=4","gravatar_id":"","url":"https://api.github.com/users/bencoullie","html_url":"https://github.com/bencoullie","followers_url":"https://api.github.com/users/bencoullie/followers","following_url":"https://api.github.com/users/bencoullie/following{/other_user}","gists_url":"https://api.github.com/users/bencoullie/gists{/gist_id}","starred_url":"https://api.github.com/users/bencoullie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bencoullie/subscriptions","organizations_url":"https://api.github.com/users/bencoullie/orgs","repos_url":"https://api.github.com/users/bencoullie/repos","events_url":"https://api.github.com/users/bencoullie/events{/privacy}","received_events_url":"https://api.github.com/users/bencoullie/received_events","type":"User","site_admin":false},"repo":{"id":151517221,"node_id":"MDEwOlJlcG9zaXRvcnkxNTE1MTcyMjE=","name":"ShittyLINQ.js","full_name":"bencoullie/ShittyLINQ.js","private":false,"owner":{"login":"bencoullie","id":6733407,"node_id":"MDQ6VXNlcjY3MzM0MDc=","avatar_url":"https://avatars0.githubusercontent.com/u/6733407?v=4","gravatar_id":"","url":"https://api.github.com/users/bencoullie","html_url":"https://github.com/bencoullie","followers_url":"https://api.github.com/users/bencoullie/followers","following_url":"https://api.github.com/users/bencoullie/following{/other_user}","gists_url":"https://api.github.com/users/bencoullie/gists{/gist_id}","starred_url":"https://api.github.com/users/bencoullie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bencoullie/subscriptions","organizations_url":"https://api.github.com/users/bencoullie/orgs","repos_url":"https://api.github.com/users/bencoullie/repos","events_url":"https://api.github.com/users/bencoullie/events{/privacy}","received_events_url":"https://api.github.com/users/bencoullie/received_events","type":"User","site_admin":false},"html_url":"https://github.com/bencoullie/ShittyLINQ.js","description":"The shitty version of LINQ in JavaScript.","fork":true,"url":"https://api.github.com/repos/bencoullie/ShittyLINQ.js","forks_url":"https://api.github.com/repos/bencoullie/ShittyLINQ.js/forks","keys_url":"https://api.github.com/repos/bencoullie/ShittyLINQ.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bencoullie/ShittyLINQ.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bencoullie/ShittyLINQ.js/teams","hooks_url":"https://api.github.com/repos/bencoullie/ShittyLINQ.js/hooks","issue_events_url":"https://api.github.com/repos/bencoullie/ShittyLINQ.js/issues/events{/number}","events_url":"https://api.github.com/repos/bencoullie/ShittyLINQ.js/events","assignees_url":"https://api.github.com/repos/bencoullie/ShittyLINQ.js/assignees{/user}","branches_url":"https://api.github.com/repos/bencoullie/ShittyLINQ.js/branches{/branch}","tags_url":"https://api.github.com/repos/bencoullie/ShittyLINQ.js/tags","blobs_url":"https://api.github.com/repos/bencoullie/ShittyLINQ.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bencoullie/ShittyLINQ.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bencoullie/ShittyLINQ.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/bencoullie/ShittyLINQ.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bencoullie/ShittyLINQ.js/statuses/{sha}","languages_url":"https://api.github.com/repos/bencoullie/ShittyLINQ.js/languages","stargazers_url":"https://api.github.com/repos/bencoullie/ShittyLINQ.js/stargazers","contributors_url":"https://api.github.com/repos/bencoullie/ShittyLINQ.js/contributors","subscribers_url":"https://api.github.com/repos/bencoullie/ShittyLINQ.js/subscribers","subscription_url":"https://api.github.com/repos/bencoullie/ShittyLINQ.js/subscription","commits_url":"https://api.github.com/repos/bencoullie/ShittyLINQ.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/bencoullie/ShittyLINQ.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/bencoullie/ShittyLINQ.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/bencoullie/ShittyLINQ.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/bencoullie/ShittyLINQ.js/contents/{+path}","compare_url":"https://api.github.com/repos/bencoullie/ShittyLINQ.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bencoullie/ShittyLINQ.js/merges","archive_url":"https://api.github.com/repos/bencoullie/ShittyLINQ.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bencoullie/ShittyLINQ.js/downloads","issues_url":"https://api.github.com/repos/bencoullie/ShittyLINQ.js/issues{/number}","pulls_url":"https://api.github.com/repos/bencoullie/ShittyLINQ.js/pulls{/number}","milestones_url":"https://api.github.com/repos/bencoullie/ShittyLINQ.js/milestones{/number}","notifications_url":"https://api.github.com/repos/bencoullie/ShittyLINQ.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bencoullie/ShittyLINQ.js/labels{/name}","releases_url":"https://api.github.com/repos/bencoullie/ShittyLINQ.js/releases{/id}","deployments_url":"https://api.github.com/repos/bencoullie/ShittyLINQ.js/deployments","created_at":"2018-10-04T04:12:40Z","updated_at":"2018-10-04T04:12:42Z","pushed_at":"2018-10-04T04:58:50Z","git_url":"git://github.com/bencoullie/ShittyLINQ.js.git","ssh_url":"git@github.com:bencoullie/ShittyLINQ.js.git","clone_url":"https://github.com/bencoullie/ShittyLINQ.js.git","svn_url":"https://github.com/bencoullie/ShittyLINQ.js","homepage":"","size":30,"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":"develop"}},"base":{"label":"jreina:develop","ref":"develop","sha":"c2e69040155713961bc89e3cecc85b12ac137046","user":{"login":"jreina","id":2089820,"node_id":"MDQ6VXNlcjIwODk4MjA=","avatar_url":"https://avatars1.githubusercontent.com/u/2089820?v=4","gravatar_id":"","url":"https://api.github.com/users/jreina","html_url":"https://github.com/jreina","followers_url":"https://api.github.com/users/jreina/followers","following_url":"https://api.github.com/users/jreina/following{/other_user}","gists_url":"https://api.github.com/users/jreina/gists{/gist_id}","starred_url":"https://api.github.com/users/jreina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jreina/subscriptions","organizations_url":"https://api.github.com/users/jreina/orgs","repos_url":"https://api.github.com/users/jreina/repos","events_url":"https://api.github.com/users/jreina/events{/privacy}","received_events_url":"https://api.github.com/users/jreina/received_events","type":"User","site_admin":false},"repo":{"id":142947645,"node_id":"MDEwOlJlcG9zaXRvcnkxNDI5NDc2NDU=","name":"ShittyLINQ.js","full_name":"jreina/ShittyLINQ.js","private":false,"owner":{"login":"jreina","id":2089820,"node_id":"MDQ6VXNlcjIwODk4MjA=","avatar_url":"https://avatars1.githubusercontent.com/u/2089820?v=4","gravatar_id":"","url":"https://api.github.com/users/jreina","html_url":"https://github.com/jreina","followers_url":"https://api.github.com/users/jreina/followers","following_url":"https://api.github.com/users/jreina/following{/other_user}","gists_url":"https://api.github.com/users/jreina/gists{/gist_id}","starred_url":"https://api.github.com/users/jreina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jreina/subscriptions","organizations_url":"https://api.github.com/users/jreina/orgs","repos_url":"https://api.github.com/users/jreina/repos","events_url":"https://api.github.com/users/jreina/events{/privacy}","received_events_url":"https://api.github.com/users/jreina/received_events","type":"User","site_admin":false},"html_url":"https://github.com/jreina/ShittyLINQ.js","description":"The shitty version of LINQ in JavaScript.","fork":false,"url":"https://api.github.com/repos/jreina/ShittyLINQ.js","forks_url":"https://api.github.com/repos/jreina/ShittyLINQ.js/forks","keys_url":"https://api.github.com/repos/jreina/ShittyLINQ.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jreina/ShittyLINQ.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jreina/ShittyLINQ.js/teams","hooks_url":"https://api.github.com/repos/jreina/ShittyLINQ.js/hooks","issue_events_url":"https://api.github.com/repos/jreina/ShittyLINQ.js/issues/events{/number}","events_url":"https://api.github.com/repos/jreina/ShittyLINQ.js/events","assignees_url":"https://api.github.com/repos/jreina/ShittyLINQ.js/assignees{/user}","branches_url":"https://api.github.com/repos/jreina/ShittyLINQ.js/branches{/branch}","tags_url":"https://api.github.com/repos/jreina/ShittyLINQ.js/tags","blobs_url":"https://api.github.com/repos/jreina/ShittyLINQ.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jreina/ShittyLINQ.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jreina/ShittyLINQ.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/jreina/ShittyLINQ.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jreina/ShittyLINQ.js/statuses/{sha}","languages_url":"https://api.github.com/repos/jreina/ShittyLINQ.js/languages","stargazers_url":"https://api.github.com/repos/jreina/ShittyLINQ.js/stargazers","contributors_url":"https://api.github.com/repos/jreina/ShittyLINQ.js/contributors","subscribers_url":"https://api.github.com/repos/jreina/ShittyLINQ.js/subscribers","subscription_url":"https://api.github.com/repos/jreina/ShittyLINQ.js/subscription","commits_url":"https://api.github.com/repos/jreina/ShittyLINQ.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/jreina/ShittyLINQ.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/jreina/ShittyLINQ.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/jreina/ShittyLINQ.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/jreina/ShittyLINQ.js/contents/{+path}","compare_url":"https://api.github.com/repos/jreina/ShittyLINQ.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jreina/ShittyLINQ.js/merges","archive_url":"https://api.github.com/repos/jreina/ShittyLINQ.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jreina/ShittyLINQ.js/downloads","issues_url":"https://api.github.com/repos/jreina/ShittyLINQ.js/issues{/number}","pulls_url":"https://api.github.com/repos/jreina/ShittyLINQ.js/pulls{/number}","milestones_url":"https://api.github.com/repos/jreina/ShittyLINQ.js/milestones{/number}","notifications_url":"https://api.github.com/repos/jreina/ShittyLINQ.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jreina/ShittyLINQ.js/labels{/name}","releases_url":"https://api.github.com/repos/jreina/ShittyLINQ.js/releases{/id}","deployments_url":"https://api.github.com/repos/jreina/ShittyLINQ.js/deployments","created_at":"2018-07-31T01:44:31Z","updated_at":"2018-10-06T13:23:30Z","pushed_at":"2018-10-06T13:39:34Z","git_url":"git://github.com/jreina/ShittyLINQ.js.git","ssh_url":"git@github.com:jreina/ShittyLINQ.js.git","clone_url":"https://github.com/jreina/ShittyLINQ.js.git","svn_url":"https://github.com/jreina/ShittyLINQ.js","homepage":"","size":36,"stargazers_count":6,"watchers_count":6,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":17,"mirror_url":null,"archived":false,"open_issues_count":46,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":17,"open_issues":46,"watchers":6,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/jreina/ShittyLINQ.js/pulls/45"},"html":{"href":"https://github.com/jreina/ShittyLINQ.js/pull/45"},"issue":{"href":"https://api.github.com/repos/jreina/ShittyLINQ.js/issues/45"},"comments":{"href":"https://api.github.com/repos/jreina/ShittyLINQ.js/issues/45/comments"},"review_comments":{"href":"https://api.github.com/repos/jreina/ShittyLINQ.js/pulls/45/comments"},"review_comment":{"href":"https://api.github.com/repos/jreina/ShittyLINQ.js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jreina/ShittyLINQ.js/pulls/45/commits"},"statuses":{"href":"https://api.github.com/repos/jreina/ShittyLINQ.js/statuses/3950ef90dd1ed2e928b3eae1924305f91e1ab4ba"}},"author_association":"NONE"}}
{"actor":{"display_login":"jreina"}}