{"action":"created","comment":{"url":"https://api.github.com/repos/urfu-2016/javascript-task-7/pulls/comments/89688897","pull_request_review_id":10229702,"id":89688897,"diff_hunk":"@@ -1,15 +1,101 @@\n 'use strict';\n \n+/* eslint no-empty-function: [\"error\", { \"allow\": [\"functions\"] }]*/\n+\n+function sortByName(firstName, secondName) {\n+    if (firstName === secondName) {\n+        return 0;\n+    }\n+\n+    return firstName > secondName ? 1 : -1;\n+}\n+\n+function getFriend(friends, name) {\n+    return friends.filter(function (friend) {\n+        return friend.name === name;\n+    })[0];\n+}\n+\n+function getBestFriendsNames(friends) {\n+    return friends\n+        .filter(function (friend) {\n+            return friend.best;\n+        })\n+        .map(function (friend) {\n+            return friend.name;\n+        });\n+}\n+\n+function getFriendsObjects(friends, visitedFriends) {\n+    return visitedFriends\n+        // Получим по именам объекты друзей\n+        .map(function (visitedFriend) {\n+            return getFriend(friends, visitedFriend);\n+        });\n+}\n+\n+function collectFriends(friends, filter, maxLevel) {","path":"lib.js","position":37,"original_position":37,"commit_id":"da3d538191db8883c02827fe25b8451363227c9d","original_commit_id":"da3d538191db8883c02827fe25b8451363227c9d","user":{"login":"Nikit0s","id":6998975,"avatar_url":"https://avatars.githubusercontent.com/u/6998975?v=3","gravatar_id":"","url":"https://api.github.com/users/Nikit0s","html_url":"https://github.com/Nikit0s","followers_url":"https://api.github.com/users/Nikit0s/followers","following_url":"https://api.github.com/users/Nikit0s/following{/other_user}","gists_url":"https://api.github.com/users/Nikit0s/gists{/gist_id}","starred_url":"https://api.github.com/users/Nikit0s/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nikit0s/subscriptions","organizations_url":"https://api.github.com/users/Nikit0s/orgs","repos_url":"https://api.github.com/users/Nikit0s/repos","events_url":"https://api.github.com/users/Nikit0s/events{/privacy}","received_events_url":"https://api.github.com/users/Nikit0s/received_events","type":"User","site_admin":false},"body":"Какая-то сложноватая для восприятия функция получилась. Сначала получаем из массива объектов друзей массив просто имен друзей, после этого снова из имени получаем объект. Вложенность функции доходит до 4ех, можно упростить","created_at":"2016-11-27T12:16:55Z","updated_at":"2016-11-27T12:16:55Z","html_url":"https://github.com/urfu-2016/javascript-task-7/pull/21#discussion_r89688897","pull_request_url":"https://api.github.com/repos/urfu-2016/javascript-task-7/pulls/21","_links":{"self":{"href":"https://api.github.com/repos/urfu-2016/javascript-task-7/pulls/comments/89688897"},"html":{"href":"https://github.com/urfu-2016/javascript-task-7/pull/21#discussion_r89688897"},"pull_request":{"href":"https://api.github.com/repos/urfu-2016/javascript-task-7/pulls/21"}}},"pull_request":{"url":"https://api.github.com/repos/urfu-2016/javascript-task-7/pulls/21","id":94928908,"html_url":"https://github.com/urfu-2016/javascript-task-7/pull/21","diff_url":"https://github.com/urfu-2016/javascript-task-7/pull/21.diff","patch_url":"https://github.com/urfu-2016/javascript-task-7/pull/21.patch","issue_url":"https://api.github.com/repos/urfu-2016/javascript-task-7/issues/21","number":21,"state":"open","locked":false,"title":"Соловьев Александр","user":{"login":"AlSoEdit","id":14929897,"avatar_url":"https://avatars.githubusercontent.com/u/14929897?v=3","gravatar_id":"","url":"https://api.github.com/users/AlSoEdit","html_url":"https://github.com/AlSoEdit","followers_url":"https://api.github.com/users/AlSoEdit/followers","following_url":"https://api.github.com/users/AlSoEdit/following{/other_user}","gists_url":"https://api.github.com/users/AlSoEdit/gists{/gist_id}","starred_url":"https://api.github.com/users/AlSoEdit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlSoEdit/subscriptions","organizations_url":"https://api.github.com/users/AlSoEdit/orgs","repos_url":"https://api.github.com/users/AlSoEdit/repos","events_url":"https://api.github.com/users/AlSoEdit/events{/privacy}","received_events_url":"https://api.github.com/users/AlSoEdit/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-11-23T01:02:53Z","updated_at":"2016-11-27T12:16:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8f2af0cefdc22873f47c750a9f97afb91330170e","assignee":{"login":"Nikit0s","id":6998975,"avatar_url":"https://avatars.githubusercontent.com/u/6998975?v=3","gravatar_id":"","url":"https://api.github.com/users/Nikit0s","html_url":"https://github.com/Nikit0s","followers_url":"https://api.github.com/users/Nikit0s/followers","following_url":"https://api.github.com/users/Nikit0s/following{/other_user}","gists_url":"https://api.github.com/users/Nikit0s/gists{/gist_id}","starred_url":"https://api.github.com/users/Nikit0s/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nikit0s/subscriptions","organizations_url":"https://api.github.com/users/Nikit0s/orgs","repos_url":"https://api.github.com/users/Nikit0s/repos","events_url":"https://api.github.com/users/Nikit0s/events{/privacy}","received_events_url":"https://api.github.com/users/Nikit0s/received_events","type":"User","site_admin":false},"assignees":[{"login":"Nikit0s","id":6998975,"avatar_url":"https://avatars.githubusercontent.com/u/6998975?v=3","gravatar_id":"","url":"https://api.github.com/users/Nikit0s","html_url":"https://github.com/Nikit0s","followers_url":"https://api.github.com/users/Nikit0s/followers","following_url":"https://api.github.com/users/Nikit0s/following{/other_user}","gists_url":"https://api.github.com/users/Nikit0s/gists{/gist_id}","starred_url":"https://api.github.com/users/Nikit0s/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nikit0s/subscriptions","organizations_url":"https://api.github.com/users/Nikit0s/orgs","repos_url":"https://api.github.com/users/Nikit0s/repos","events_url":"https://api.github.com/users/Nikit0s/events{/privacy}","received_events_url":"https://api.github.com/users/Nikit0s/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/urfu-2016/javascript-task-7/pulls/21/commits","review_comments_url":"https://api.github.com/repos/urfu-2016/javascript-task-7/pulls/21/comments","review_comment_url":"https://api.github.com/repos/urfu-2016/javascript-task-7/pulls/comments{/number}","comments_url":"https://api.github.com/repos/urfu-2016/javascript-task-7/issues/21/comments","statuses_url":"https://api.github.com/repos/urfu-2016/javascript-task-7/statuses/da3d538191db8883c02827fe25b8451363227c9d","head":{"label":"AlSoEdit:master","ref":"master","sha":"da3d538191db8883c02827fe25b8451363227c9d","user":{"login":"AlSoEdit","id":14929897,"avatar_url":"https://avatars.githubusercontent.com/u/14929897?v=3","gravatar_id":"","url":"https://api.github.com/users/AlSoEdit","html_url":"https://github.com/AlSoEdit","followers_url":"https://api.github.com/users/AlSoEdit/followers","following_url":"https://api.github.com/users/AlSoEdit/following{/other_user}","gists_url":"https://api.github.com/users/AlSoEdit/gists{/gist_id}","starred_url":"https://api.github.com/users/AlSoEdit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlSoEdit/subscriptions","organizations_url":"https://api.github.com/users/AlSoEdit/orgs","repos_url":"https://api.github.com/users/AlSoEdit/repos","events_url":"https://api.github.com/users/AlSoEdit/events{/privacy}","received_events_url":"https://api.github.com/users/AlSoEdit/received_events","type":"User","site_admin":false},"repo":{"id":74473325,"name":"javascript-task-7","full_name":"AlSoEdit/javascript-task-7","owner":{"login":"AlSoEdit","id":14929897,"avatar_url":"https://avatars.githubusercontent.com/u/14929897?v=3","gravatar_id":"","url":"https://api.github.com/users/AlSoEdit","html_url":"https://github.com/AlSoEdit","followers_url":"https://api.github.com/users/AlSoEdit/followers","following_url":"https://api.github.com/users/AlSoEdit/following{/other_user}","gists_url":"https://api.github.com/users/AlSoEdit/gists{/gist_id}","starred_url":"https://api.github.com/users/AlSoEdit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlSoEdit/subscriptions","organizations_url":"https://api.github.com/users/AlSoEdit/orgs","repos_url":"https://api.github.com/users/AlSoEdit/repos","events_url":"https://api.github.com/users/AlSoEdit/events{/privacy}","received_events_url":"https://api.github.com/users/AlSoEdit/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AlSoEdit/javascript-task-7","description":"Задача «Свадьба Билли»","fork":true,"url":"https://api.github.com/repos/AlSoEdit/javascript-task-7","forks_url":"https://api.github.com/repos/AlSoEdit/javascript-task-7/forks","keys_url":"https://api.github.com/repos/AlSoEdit/javascript-task-7/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AlSoEdit/javascript-task-7/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AlSoEdit/javascript-task-7/teams","hooks_url":"https://api.github.com/repos/AlSoEdit/javascript-task-7/hooks","issue_events_url":"https://api.github.com/repos/AlSoEdit/javascript-task-7/issues/events{/number}","events_url":"https://api.github.com/repos/AlSoEdit/javascript-task-7/events","assignees_url":"https://api.github.com/repos/AlSoEdit/javascript-task-7/assignees{/user}","branches_url":"https://api.github.com/repos/AlSoEdit/javascript-task-7/branches{/branch}","tags_url":"https://api.github.com/repos/AlSoEdit/javascript-task-7/tags","blobs_url":"https://api.github.com/repos/AlSoEdit/javascript-task-7/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AlSoEdit/javascript-task-7/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AlSoEdit/javascript-task-7/git/refs{/sha}","trees_url":"https://api.github.com/repos/AlSoEdit/javascript-task-7/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AlSoEdit/javascript-task-7/statuses/{sha}","languages_url":"https://api.github.com/repos/AlSoEdit/javascript-task-7/languages","stargazers_url":"https://api.github.com/repos/AlSoEdit/javascript-task-7/stargazers","contributors_url":"https://api.github.com/repos/AlSoEdit/javascript-task-7/contributors","subscribers_url":"https://api.github.com/repos/AlSoEdit/javascript-task-7/subscribers","subscription_url":"https://api.github.com/repos/AlSoEdit/javascript-task-7/subscription","commits_url":"https://api.github.com/repos/AlSoEdit/javascript-task-7/commits{/sha}","git_commits_url":"https://api.github.com/repos/AlSoEdit/javascript-task-7/git/commits{/sha}","comments_url":"https://api.github.com/repos/AlSoEdit/javascript-task-7/comments{/number}","issue_comment_url":"https://api.github.com/repos/AlSoEdit/javascript-task-7/issues/comments{/number}","contents_url":"https://api.github.com/repos/AlSoEdit/javascript-task-7/contents/{+path}","compare_url":"https://api.github.com/repos/AlSoEdit/javascript-task-7/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AlSoEdit/javascript-task-7/merges","archive_url":"https://api.github.com/repos/AlSoEdit/javascript-task-7/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AlSoEdit/javascript-task-7/downloads","issues_url":"https://api.github.com/repos/AlSoEdit/javascript-task-7/issues{/number}","pulls_url":"https://api.github.com/repos/AlSoEdit/javascript-task-7/pulls{/number}","milestones_url":"https://api.github.com/repos/AlSoEdit/javascript-task-7/milestones{/number}","notifications_url":"https://api.github.com/repos/AlSoEdit/javascript-task-7/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AlSoEdit/javascript-task-7/labels{/name}","releases_url":"https://api.github.com/repos/AlSoEdit/javascript-task-7/releases{/id}","deployments_url":"https://api.github.com/repos/AlSoEdit/javascript-task-7/deployments","created_at":"2016-11-22T13:07:25Z","updated_at":"2016-11-22T13:07:26Z","pushed_at":"2016-11-27T10:23:42Z","git_url":"git://github.com/AlSoEdit/javascript-task-7.git","ssh_url":"git@github.com:AlSoEdit/javascript-task-7.git","clone_url":"https://github.com/AlSoEdit/javascript-task-7.git","svn_url":"https://github.com/AlSoEdit/javascript-task-7","homepage":"","size":23,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"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":0,"default_branch":"master"}},"base":{"label":"urfu-2016:master","ref":"master","sha":"4a22d2747c173e3a56c93789b501c871e3d20971","user":{"login":"urfu-2016","id":22170529,"avatar_url":"https://avatars.githubusercontent.com/u/22170529?v=3","gravatar_id":"","url":"https://api.github.com/users/urfu-2016","html_url":"https://github.com/urfu-2016","followers_url":"https://api.github.com/users/urfu-2016/followers","following_url":"https://api.github.com/users/urfu-2016/following{/other_user}","gists_url":"https://api.github.com/users/urfu-2016/gists{/gist_id}","starred_url":"https://api.github.com/users/urfu-2016/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/urfu-2016/subscriptions","organizations_url":"https://api.github.com/users/urfu-2016/orgs","repos_url":"https://api.github.com/users/urfu-2016/repos","events_url":"https://api.github.com/users/urfu-2016/events{/privacy}","received_events_url":"https://api.github.com/users/urfu-2016/received_events","type":"Organization","site_admin":false},"repo":{"id":74001255,"name":"javascript-task-7","full_name":"urfu-2016/javascript-task-7","owner":{"login":"urfu-2016","id":22170529,"avatar_url":"https://avatars.githubusercontent.com/u/22170529?v=3","gravatar_id":"","url":"https://api.github.com/users/urfu-2016","html_url":"https://github.com/urfu-2016","followers_url":"https://api.github.com/users/urfu-2016/followers","following_url":"https://api.github.com/users/urfu-2016/following{/other_user}","gists_url":"https://api.github.com/users/urfu-2016/gists{/gist_id}","starred_url":"https://api.github.com/users/urfu-2016/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/urfu-2016/subscriptions","organizations_url":"https://api.github.com/users/urfu-2016/orgs","repos_url":"https://api.github.com/users/urfu-2016/repos","events_url":"https://api.github.com/users/urfu-2016/events{/privacy}","received_events_url":"https://api.github.com/users/urfu-2016/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/urfu-2016/javascript-task-7","description":"Задача «Свадьба Билли»","fork":false,"url":"https://api.github.com/repos/urfu-2016/javascript-task-7","forks_url":"https://api.github.com/repos/urfu-2016/javascript-task-7/forks","keys_url":"https://api.github.com/repos/urfu-2016/javascript-task-7/keys{/key_id}","collaborators_url":"https://api.github.com/repos/urfu-2016/javascript-task-7/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/urfu-2016/javascript-task-7/teams","hooks_url":"https://api.github.com/repos/urfu-2016/javascript-task-7/hooks","issue_events_url":"https://api.github.com/repos/urfu-2016/javascript-task-7/issues/events{/number}","events_url":"https://api.github.com/repos/urfu-2016/javascript-task-7/events","assignees_url":"https://api.github.com/repos/urfu-2016/javascript-task-7/assignees{/user}","branches_url":"https://api.github.com/repos/urfu-2016/javascript-task-7/branches{/branch}","tags_url":"https://api.github.com/repos/urfu-2016/javascript-task-7/tags","blobs_url":"https://api.github.com/repos/urfu-2016/javascript-task-7/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/urfu-2016/javascript-task-7/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/urfu-2016/javascript-task-7/git/refs{/sha}","trees_url":"https://api.github.com/repos/urfu-2016/javascript-task-7/git/trees{/sha}","statuses_url":"https://api.github.com/repos/urfu-2016/javascript-task-7/statuses/{sha}","languages_url":"https://api.github.com/repos/urfu-2016/javascript-task-7/languages","stargazers_url":"https://api.github.com/repos/urfu-2016/javascript-task-7/stargazers","contributors_url":"https://api.github.com/repos/urfu-2016/javascript-task-7/contributors","subscribers_url":"https://api.github.com/repos/urfu-2016/javascript-task-7/subscribers","subscription_url":"https://api.github.com/repos/urfu-2016/javascript-task-7/subscription","commits_url":"https://api.github.com/repos/urfu-2016/javascript-task-7/commits{/sha}","git_commits_url":"https://api.github.com/repos/urfu-2016/javascript-task-7/git/commits{/sha}","comments_url":"https://api.github.com/repos/urfu-2016/javascript-task-7/comments{/number}","issue_comment_url":"https://api.github.com/repos/urfu-2016/javascript-task-7/issues/comments{/number}","contents_url":"https://api.github.com/repos/urfu-2016/javascript-task-7/contents/{+path}","compare_url":"https://api.github.com/repos/urfu-2016/javascript-task-7/compare/{base}...{head}","merges_url":"https://api.github.com/repos/urfu-2016/javascript-task-7/merges","archive_url":"https://api.github.com/repos/urfu-2016/javascript-task-7/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/urfu-2016/javascript-task-7/downloads","issues_url":"https://api.github.com/repos/urfu-2016/javascript-task-7/issues{/number}","pulls_url":"https://api.github.com/repos/urfu-2016/javascript-task-7/pulls{/number}","milestones_url":"https://api.github.com/repos/urfu-2016/javascript-task-7/milestones{/number}","notifications_url":"https://api.github.com/repos/urfu-2016/javascript-task-7/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/urfu-2016/javascript-task-7/labels{/name}","releases_url":"https://api.github.com/repos/urfu-2016/javascript-task-7/releases{/id}","deployments_url":"https://api.github.com/repos/urfu-2016/javascript-task-7/deployments","created_at":"2016-11-17T07:24:15Z","updated_at":"2016-11-17T14:07:08Z","pushed_at":"2016-11-27T10:23:42Z","git_url":"git://github.com/urfu-2016/javascript-task-7.git","ssh_url":"git@github.com:urfu-2016/javascript-task-7.git","clone_url":"https://github.com/urfu-2016/javascript-task-7.git","svn_url":"https://github.com/urfu-2016/javascript-task-7","homepage":"","size":12,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":49,"mirror_url":null,"open_issues_count":31,"forks":49,"open_issues":31,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/urfu-2016/javascript-task-7/pulls/21"},"html":{"href":"https://github.com/urfu-2016/javascript-task-7/pull/21"},"issue":{"href":"https://api.github.com/repos/urfu-2016/javascript-task-7/issues/21"},"comments":{"href":"https://api.github.com/repos/urfu-2016/javascript-task-7/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/urfu-2016/javascript-task-7/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/urfu-2016/javascript-task-7/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/urfu-2016/javascript-task-7/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/urfu-2016/javascript-task-7/statuses/da3d538191db8883c02827fe25b8451363227c9d"}}}}
{"actor":{"display_login":"Nikit0s"}}