{"action":"created","comment":{"url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/pulls/comments/43358061","id":43358061,"diff_hunk":"@@ -0,0 +1,50 @@\n+import friendsIterator, {GO_BACKWARD} from './FriendsIterator';\n+\n+export const get = function (collection, startPoint, depth) {\n+    const it = friendsIterator(collection, startPoint, depth);\n+    it.next();\n+    return new GenderIterator(it);\n+};\n+\n+const filterByName = name => obj => obj.name === name;\n+const filterByGender = gender => obj => obj.gender === gender;\n+\n+const always = () => true;\n+\n+const findBy = (filterFn, next) => {\n+    let result;\n+    while (result = next().value) {\n+        if (filterFn(result)) {\n+            break;\n+        }\n+    }\n+    return result;\n+};\n+\n+class GenderIterator {\n+    constructor(iterator) {\n+        this.iterator = iterator;\n+    }\n+\n+    next(name) {\n+        var it = this.iterator;\n+        return findBy(!name ? always : filterByName(name), it::it.next);\n+    }\n+\n+    prev(name) {\n+        var it = this.iterator;\n+        return findBy(!name ? always : filterByName(name),\n+            it.next.bind(it, GO_BACKWARD));","path":"src/iterator.js","position":37,"original_position":37,"commit_id":"058edf28669f8520a1b52fd3f1966e66f7ab8492","original_commit_id":"058edf28669f8520a1b52fd3f1966e66f7ab8492","user":{"login":"ZigGreen","id":3829895,"avatar_url":"https://avatars.githubusercontent.com/u/3829895?v=3","gravatar_id":"","url":"https://api.github.com/users/ZigGreen","html_url":"https://github.com/ZigGreen","followers_url":"https://api.github.com/users/ZigGreen/followers","following_url":"https://api.github.com/users/ZigGreen/following{/other_user}","gists_url":"https://api.github.com/users/ZigGreen/gists{/gist_id}","starred_url":"https://api.github.com/users/ZigGreen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZigGreen/subscriptions","organizations_url":"https://api.github.com/users/ZigGreen/orgs","repos_url":"https://api.github.com/users/ZigGreen/repos","events_url":"https://api.github.com/users/ZigGreen/events{/privacy}","received_events_url":"https://api.github.com/users/ZigGreen/received_events","type":"User","site_admin":false},"body":"Я понял как лично ты (лично ты) бы это написал.","created_at":"2015-10-29T08:05:41Z","updated_at":"2015-10-29T08:05:41Z","html_url":"https://github.com/urfu-2015/javascript-tasks-4/pull/6#discussion_r43358061","pull_request_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/pulls/comments/43358061"},"html":{"href":"https://github.com/urfu-2015/javascript-tasks-4/pull/6#discussion_r43358061"},"pull_request":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/pulls/6","id":48324141,"html_url":"https://github.com/urfu-2015/javascript-tasks-4/pull/6","diff_url":"https://github.com/urfu-2015/javascript-tasks-4/pull/6.diff","patch_url":"https://github.com/urfu-2015/javascript-tasks-4/pull/6.patch","issue_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/issues/6","number":6,"state":"open","locked":false,"title":"Банару Кирилл","user":{"login":"ZigGreen","id":3829895,"avatar_url":"https://avatars.githubusercontent.com/u/3829895?v=3","gravatar_id":"","url":"https://api.github.com/users/ZigGreen","html_url":"https://github.com/ZigGreen","followers_url":"https://api.github.com/users/ZigGreen/followers","following_url":"https://api.github.com/users/ZigGreen/following{/other_user}","gists_url":"https://api.github.com/users/ZigGreen/gists{/gist_id}","starred_url":"https://api.github.com/users/ZigGreen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZigGreen/subscriptions","organizations_url":"https://api.github.com/users/ZigGreen/orgs","repos_url":"https://api.github.com/users/ZigGreen/repos","events_url":"https://api.github.com/users/ZigGreen/events{/privacy}","received_events_url":"https://api.github.com/users/ZigGreen/received_events","type":"User","site_admin":false},"body":"назначте на ревью @evilj0e плз ","created_at":"2015-10-21T12:27:12Z","updated_at":"2015-10-29T08:05:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"aa8721cd0d10ea6ca55e2618a148ebabd21df5f3","assignee":{"login":"sameoldmadness","id":1537724,"avatar_url":"https://avatars.githubusercontent.com/u/1537724?v=3","gravatar_id":"","url":"https://api.github.com/users/sameoldmadness","html_url":"https://github.com/sameoldmadness","followers_url":"https://api.github.com/users/sameoldmadness/followers","following_url":"https://api.github.com/users/sameoldmadness/following{/other_user}","gists_url":"https://api.github.com/users/sameoldmadness/gists{/gist_id}","starred_url":"https://api.github.com/users/sameoldmadness/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sameoldmadness/subscriptions","organizations_url":"https://api.github.com/users/sameoldmadness/orgs","repos_url":"https://api.github.com/users/sameoldmadness/repos","events_url":"https://api.github.com/users/sameoldmadness/events{/privacy}","received_events_url":"https://api.github.com/users/sameoldmadness/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/pulls/6/commits","review_comments_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/pulls/6/comments","review_comment_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/pulls/comments{/number}","comments_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/issues/6/comments","statuses_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/statuses/058edf28669f8520a1b52fd3f1966e66f7ab8492","head":{"label":"ZigGreen:master","ref":"master","sha":"058edf28669f8520a1b52fd3f1966e66f7ab8492","user":{"login":"ZigGreen","id":3829895,"avatar_url":"https://avatars.githubusercontent.com/u/3829895?v=3","gravatar_id":"","url":"https://api.github.com/users/ZigGreen","html_url":"https://github.com/ZigGreen","followers_url":"https://api.github.com/users/ZigGreen/followers","following_url":"https://api.github.com/users/ZigGreen/following{/other_user}","gists_url":"https://api.github.com/users/ZigGreen/gists{/gist_id}","starred_url":"https://api.github.com/users/ZigGreen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZigGreen/subscriptions","organizations_url":"https://api.github.com/users/ZigGreen/orgs","repos_url":"https://api.github.com/users/ZigGreen/repos","events_url":"https://api.github.com/users/ZigGreen/events{/privacy}","received_events_url":"https://api.github.com/users/ZigGreen/received_events","type":"User","site_admin":false},"repo":{"id":44616658,"name":"javascript-tasks-4","full_name":"ZigGreen/javascript-tasks-4","owner":{"login":"ZigGreen","id":3829895,"avatar_url":"https://avatars.githubusercontent.com/u/3829895?v=3","gravatar_id":"","url":"https://api.github.com/users/ZigGreen","html_url":"https://github.com/ZigGreen","followers_url":"https://api.github.com/users/ZigGreen/followers","following_url":"https://api.github.com/users/ZigGreen/following{/other_user}","gists_url":"https://api.github.com/users/ZigGreen/gists{/gist_id}","starred_url":"https://api.github.com/users/ZigGreen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZigGreen/subscriptions","organizations_url":"https://api.github.com/users/ZigGreen/orgs","repos_url":"https://api.github.com/users/ZigGreen/repos","events_url":"https://api.github.com/users/ZigGreen/events{/privacy}","received_events_url":"https://api.github.com/users/ZigGreen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ZigGreen/javascript-tasks-4","description":"","fork":true,"url":"https://api.github.com/repos/ZigGreen/javascript-tasks-4","forks_url":"https://api.github.com/repos/ZigGreen/javascript-tasks-4/forks","keys_url":"https://api.github.com/repos/ZigGreen/javascript-tasks-4/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ZigGreen/javascript-tasks-4/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ZigGreen/javascript-tasks-4/teams","hooks_url":"https://api.github.com/repos/ZigGreen/javascript-tasks-4/hooks","issue_events_url":"https://api.github.com/repos/ZigGreen/javascript-tasks-4/issues/events{/number}","events_url":"https://api.github.com/repos/ZigGreen/javascript-tasks-4/events","assignees_url":"https://api.github.com/repos/ZigGreen/javascript-tasks-4/assignees{/user}","branches_url":"https://api.github.com/repos/ZigGreen/javascript-tasks-4/branches{/branch}","tags_url":"https://api.github.com/repos/ZigGreen/javascript-tasks-4/tags","blobs_url":"https://api.github.com/repos/ZigGreen/javascript-tasks-4/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ZigGreen/javascript-tasks-4/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ZigGreen/javascript-tasks-4/git/refs{/sha}","trees_url":"https://api.github.com/repos/ZigGreen/javascript-tasks-4/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ZigGreen/javascript-tasks-4/statuses/{sha}","languages_url":"https://api.github.com/repos/ZigGreen/javascript-tasks-4/languages","stargazers_url":"https://api.github.com/repos/ZigGreen/javascript-tasks-4/stargazers","contributors_url":"https://api.github.com/repos/ZigGreen/javascript-tasks-4/contributors","subscribers_url":"https://api.github.com/repos/ZigGreen/javascript-tasks-4/subscribers","subscription_url":"https://api.github.com/repos/ZigGreen/javascript-tasks-4/subscription","commits_url":"https://api.github.com/repos/ZigGreen/javascript-tasks-4/commits{/sha}","git_commits_url":"https://api.github.com/repos/ZigGreen/javascript-tasks-4/git/commits{/sha}","comments_url":"https://api.github.com/repos/ZigGreen/javascript-tasks-4/comments{/number}","issue_comment_url":"https://api.github.com/repos/ZigGreen/javascript-tasks-4/issues/comments{/number}","contents_url":"https://api.github.com/repos/ZigGreen/javascript-tasks-4/contents/{+path}","compare_url":"https://api.github.com/repos/ZigGreen/javascript-tasks-4/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ZigGreen/javascript-tasks-4/merges","archive_url":"https://api.github.com/repos/ZigGreen/javascript-tasks-4/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ZigGreen/javascript-tasks-4/downloads","issues_url":"https://api.github.com/repos/ZigGreen/javascript-tasks-4/issues{/number}","pulls_url":"https://api.github.com/repos/ZigGreen/javascript-tasks-4/pulls{/number}","milestones_url":"https://api.github.com/repos/ZigGreen/javascript-tasks-4/milestones{/number}","notifications_url":"https://api.github.com/repos/ZigGreen/javascript-tasks-4/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ZigGreen/javascript-tasks-4/labels{/name}","releases_url":"https://api.github.com/repos/ZigGreen/javascript-tasks-4/releases{/id}","created_at":"2015-10-20T15:40:54Z","updated_at":"2015-10-20T15:40:55Z","pushed_at":"2015-10-29T06:18:09Z","git_url":"git://github.com/ZigGreen/javascript-tasks-4.git","ssh_url":"git@github.com:ZigGreen/javascript-tasks-4.git","clone_url":"https://github.com/ZigGreen/javascript-tasks-4.git","svn_url":"https://github.com/ZigGreen/javascript-tasks-4","homepage":null,"size":94,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"urfu-2015:master","ref":"master","sha":"6a66099e0cce3103fea6749633962c0f8ba1b74f","user":{"login":"urfu-2015","id":14800971,"avatar_url":"https://avatars.githubusercontent.com/u/14800971?v=3","gravatar_id":"","url":"https://api.github.com/users/urfu-2015","html_url":"https://github.com/urfu-2015","followers_url":"https://api.github.com/users/urfu-2015/followers","following_url":"https://api.github.com/users/urfu-2015/following{/other_user}","gists_url":"https://api.github.com/users/urfu-2015/gists{/gist_id}","starred_url":"https://api.github.com/users/urfu-2015/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/urfu-2015/subscriptions","organizations_url":"https://api.github.com/users/urfu-2015/orgs","repos_url":"https://api.github.com/users/urfu-2015/repos","events_url":"https://api.github.com/users/urfu-2015/events{/privacy}","received_events_url":"https://api.github.com/users/urfu-2015/received_events","type":"Organization","site_admin":false},"repo":{"id":44542271,"name":"javascript-tasks-4","full_name":"urfu-2015/javascript-tasks-4","owner":{"login":"urfu-2015","id":14800971,"avatar_url":"https://avatars.githubusercontent.com/u/14800971?v=3","gravatar_id":"","url":"https://api.github.com/users/urfu-2015","html_url":"https://github.com/urfu-2015","followers_url":"https://api.github.com/users/urfu-2015/followers","following_url":"https://api.github.com/users/urfu-2015/following{/other_user}","gists_url":"https://api.github.com/users/urfu-2015/gists{/gist_id}","starred_url":"https://api.github.com/users/urfu-2015/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/urfu-2015/subscriptions","organizations_url":"https://api.github.com/users/urfu-2015/orgs","repos_url":"https://api.github.com/users/urfu-2015/repos","events_url":"https://api.github.com/users/urfu-2015/events{/privacy}","received_events_url":"https://api.github.com/users/urfu-2015/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/urfu-2015/javascript-tasks-4","description":"Задача к лекции «Замыкания в Javascript» – «Мальчишник в Вегасе»","fork":false,"url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4","forks_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/forks","keys_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/keys{/key_id}","collaborators_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/teams","hooks_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/hooks","issue_events_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/issues/events{/number}","events_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/events","assignees_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/assignees{/user}","branches_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/branches{/branch}","tags_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/tags","blobs_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/git/refs{/sha}","trees_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/git/trees{/sha}","statuses_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/statuses/{sha}","languages_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/languages","stargazers_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/stargazers","contributors_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/contributors","subscribers_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/subscribers","subscription_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/subscription","commits_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/commits{/sha}","git_commits_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/git/commits{/sha}","comments_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/comments{/number}","issue_comment_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/issues/comments{/number}","contents_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/contents/{+path}","compare_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/compare/{base}...{head}","merges_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/merges","archive_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/downloads","issues_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/issues{/number}","pulls_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/pulls{/number}","milestones_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/milestones{/number}","notifications_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/labels{/name}","releases_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/releases{/id}","created_at":"2015-10-19T14:57:11Z","updated_at":"2015-10-20T18:57:43Z","pushed_at":"2015-10-29T06:18:09Z","git_url":"git://github.com/urfu-2015/javascript-tasks-4.git","ssh_url":"git@github.com:urfu-2015/javascript-tasks-4.git","clone_url":"https://github.com/urfu-2015/javascript-tasks-4.git","svn_url":"https://github.com/urfu-2015/javascript-tasks-4","homepage":"","size":1471,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":61,"mirror_url":null,"open_issues_count":42,"forks":61,"open_issues":42,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/pulls/6"},"html":{"href":"https://github.com/urfu-2015/javascript-tasks-4/pull/6"},"issue":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/issues/6"},"comments":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-4/statuses/058edf28669f8520a1b52fd3f1966e66f7ab8492"}}}}