{"action":"created","comment":{"url":"https://api.github.com/repos/urfu-2016/javascript-task-4/pulls/comments/85987421","pull_request_review_id":6667804,"id":85987421,"diff_hunk":"@@ -6,84 +6,141 @@\n  */\n exports.isStar = true;\n \n-/**\n- * Запрос к коллекции\n- * @param {Array} collection\n- * @params {...Function} – Функции для запроса\n- * @returns {Array}\n- */\n+\n exports.query = function (collection) {\n-    return collection;\n+    var copy = collection.map(function (entry) {\n+        return Object.assign({}, entry);\n+    });\n+    var operators = [].slice.call(arguments, 1);\n+    operators.sort(sortByPriority);\n+    for (var i = 0; i < operators.length; i++) {\n+        copy = operators[i](copy);\n+    }\n+\n+    return copy;\n };\n \n-/**\n- * Выбор полей\n- * @params {...String}\n- */\n+function sortByPriority(a, b) {\n+    var priority = ['filterIn', 'and', 'or', 'sortBy', 'select', 'limit', 'format'];\n+\n+    return priority.indexOf(b.name) < priority.indexOf(a.name);\n+}\n+\n+\n exports.select = function () {\n-    return;\n+    var params = [].slice.call(arguments);\n+\n+    return function select(collection) {\n+        var copy = collection.slice();","path":"lego.js","position":41,"original_position":41,"commit_id":"bafc611450a4d345bacb7a0f625cd6972947878f","original_commit_id":"bafc611450a4d345bacb7a0f625cd6972947878f","user":{"login":"Lakate","id":8994274,"avatar_url":"https://avatars.githubusercontent.com/u/8994274?v=3","gravatar_id":"","url":"https://api.github.com/users/Lakate","html_url":"https://github.com/Lakate","followers_url":"https://api.github.com/users/Lakate/followers","following_url":"https://api.github.com/users/Lakate/following{/other_user}","gists_url":"https://api.github.com/users/Lakate/gists{/gist_id}","starred_url":"https://api.github.com/users/Lakate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lakate/subscriptions","organizations_url":"https://api.github.com/users/Lakate/orgs","repos_url":"https://api.github.com/users/Lakate/repos","events_url":"https://api.github.com/users/Lakate/events{/privacy}","received_events_url":"https://api.github.com/users/Lakate/received_events","type":"User","site_admin":false},"body":"тут тоже давай поменяем название","created_at":"2016-11-01T18:02:47Z","updated_at":"2016-11-01T18:02:47Z","html_url":"https://github.com/urfu-2016/javascript-task-4/pull/15#discussion_r85987421","pull_request_url":"https://api.github.com/repos/urfu-2016/javascript-task-4/pulls/15","_links":{"self":{"href":"https://api.github.com/repos/urfu-2016/javascript-task-4/pulls/comments/85987421"},"html":{"href":"https://github.com/urfu-2016/javascript-task-4/pull/15#discussion_r85987421"},"pull_request":{"href":"https://api.github.com/repos/urfu-2016/javascript-task-4/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/urfu-2016/javascript-task-4/pulls/15","id":91528723,"html_url":"https://github.com/urfu-2016/javascript-task-4/pull/15","diff_url":"https://github.com/urfu-2016/javascript-task-4/pull/15.diff","patch_url":"https://github.com/urfu-2016/javascript-task-4/pull/15.patch","issue_url":"https://api.github.com/repos/urfu-2016/javascript-task-4/issues/15","number":15,"state":"open","locked":false,"title":"Заморский Глеб","user":{"login":"Zeace","id":22629906,"avatar_url":"https://avatars.githubusercontent.com/u/22629906?v=3","gravatar_id":"","url":"https://api.github.com/users/Zeace","html_url":"https://github.com/Zeace","followers_url":"https://api.github.com/users/Zeace/followers","following_url":"https://api.github.com/users/Zeace/following{/other_user}","gists_url":"https://api.github.com/users/Zeace/gists{/gist_id}","starred_url":"https://api.github.com/users/Zeace/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zeace/subscriptions","organizations_url":"https://api.github.com/users/Zeace/orgs","repos_url":"https://api.github.com/users/Zeace/repos","events_url":"https://api.github.com/users/Zeace/events{/privacy}","received_events_url":"https://api.github.com/users/Zeace/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-10-30T17:22:22Z","updated_at":"2016-11-01T18:13:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"00fdc75947b196d686cdbbfc2683787116a02369","assignee":{"login":"Lakate","id":8994274,"avatar_url":"https://avatars.githubusercontent.com/u/8994274?v=3","gravatar_id":"","url":"https://api.github.com/users/Lakate","html_url":"https://github.com/Lakate","followers_url":"https://api.github.com/users/Lakate/followers","following_url":"https://api.github.com/users/Lakate/following{/other_user}","gists_url":"https://api.github.com/users/Lakate/gists{/gist_id}","starred_url":"https://api.github.com/users/Lakate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lakate/subscriptions","organizations_url":"https://api.github.com/users/Lakate/orgs","repos_url":"https://api.github.com/users/Lakate/repos","events_url":"https://api.github.com/users/Lakate/events{/privacy}","received_events_url":"https://api.github.com/users/Lakate/received_events","type":"User","site_admin":false},"assignees":[{"login":"Lakate","id":8994274,"avatar_url":"https://avatars.githubusercontent.com/u/8994274?v=3","gravatar_id":"","url":"https://api.github.com/users/Lakate","html_url":"https://github.com/Lakate","followers_url":"https://api.github.com/users/Lakate/followers","following_url":"https://api.github.com/users/Lakate/following{/other_user}","gists_url":"https://api.github.com/users/Lakate/gists{/gist_id}","starred_url":"https://api.github.com/users/Lakate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lakate/subscriptions","organizations_url":"https://api.github.com/users/Lakate/orgs","repos_url":"https://api.github.com/users/Lakate/repos","events_url":"https://api.github.com/users/Lakate/events{/privacy}","received_events_url":"https://api.github.com/users/Lakate/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/urfu-2016/javascript-task-4/pulls/15/commits","review_comments_url":"https://api.github.com/repos/urfu-2016/javascript-task-4/pulls/15/comments","review_comment_url":"https://api.github.com/repos/urfu-2016/javascript-task-4/pulls/comments{/number}","comments_url":"https://api.github.com/repos/urfu-2016/javascript-task-4/issues/15/comments","statuses_url":"https://api.github.com/repos/urfu-2016/javascript-task-4/statuses/bafc611450a4d345bacb7a0f625cd6972947878f","head":{"label":"Zeace:master","ref":"master","sha":"bafc611450a4d345bacb7a0f625cd6972947878f","user":{"login":"Zeace","id":22629906,"avatar_url":"https://avatars.githubusercontent.com/u/22629906?v=3","gravatar_id":"","url":"https://api.github.com/users/Zeace","html_url":"https://github.com/Zeace","followers_url":"https://api.github.com/users/Zeace/followers","following_url":"https://api.github.com/users/Zeace/following{/other_user}","gists_url":"https://api.github.com/users/Zeace/gists{/gist_id}","starred_url":"https://api.github.com/users/Zeace/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zeace/subscriptions","organizations_url":"https://api.github.com/users/Zeace/orgs","repos_url":"https://api.github.com/users/Zeace/repos","events_url":"https://api.github.com/users/Zeace/events{/privacy}","received_events_url":"https://api.github.com/users/Zeace/received_events","type":"User","site_admin":false},"repo":{"id":72124192,"name":"javascript-task-4","full_name":"Zeace/javascript-task-4","owner":{"login":"Zeace","id":22629906,"avatar_url":"https://avatars.githubusercontent.com/u/22629906?v=3","gravatar_id":"","url":"https://api.github.com/users/Zeace","html_url":"https://github.com/Zeace","followers_url":"https://api.github.com/users/Zeace/followers","following_url":"https://api.github.com/users/Zeace/following{/other_user}","gists_url":"https://api.github.com/users/Zeace/gists{/gist_id}","starred_url":"https://api.github.com/users/Zeace/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zeace/subscriptions","organizations_url":"https://api.github.com/users/Zeace/orgs","repos_url":"https://api.github.com/users/Zeace/repos","events_url":"https://api.github.com/users/Zeace/events{/privacy}","received_events_url":"https://api.github.com/users/Zeace/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Zeace/javascript-task-4","description":"Задача «Картофельная вечеринка»","fork":true,"url":"https://api.github.com/repos/Zeace/javascript-task-4","forks_url":"https://api.github.com/repos/Zeace/javascript-task-4/forks","keys_url":"https://api.github.com/repos/Zeace/javascript-task-4/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Zeace/javascript-task-4/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Zeace/javascript-task-4/teams","hooks_url":"https://api.github.com/repos/Zeace/javascript-task-4/hooks","issue_events_url":"https://api.github.com/repos/Zeace/javascript-task-4/issues/events{/number}","events_url":"https://api.github.com/repos/Zeace/javascript-task-4/events","assignees_url":"https://api.github.com/repos/Zeace/javascript-task-4/assignees{/user}","branches_url":"https://api.github.com/repos/Zeace/javascript-task-4/branches{/branch}","tags_url":"https://api.github.com/repos/Zeace/javascript-task-4/tags","blobs_url":"https://api.github.com/repos/Zeace/javascript-task-4/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Zeace/javascript-task-4/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Zeace/javascript-task-4/git/refs{/sha}","trees_url":"https://api.github.com/repos/Zeace/javascript-task-4/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Zeace/javascript-task-4/statuses/{sha}","languages_url":"https://api.github.com/repos/Zeace/javascript-task-4/languages","stargazers_url":"https://api.github.com/repos/Zeace/javascript-task-4/stargazers","contributors_url":"https://api.github.com/repos/Zeace/javascript-task-4/contributors","subscribers_url":"https://api.github.com/repos/Zeace/javascript-task-4/subscribers","subscription_url":"https://api.github.com/repos/Zeace/javascript-task-4/subscription","commits_url":"https://api.github.com/repos/Zeace/javascript-task-4/commits{/sha}","git_commits_url":"https://api.github.com/repos/Zeace/javascript-task-4/git/commits{/sha}","comments_url":"https://api.github.com/repos/Zeace/javascript-task-4/comments{/number}","issue_comment_url":"https://api.github.com/repos/Zeace/javascript-task-4/issues/comments{/number}","contents_url":"https://api.github.com/repos/Zeace/javascript-task-4/contents/{+path}","compare_url":"https://api.github.com/repos/Zeace/javascript-task-4/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Zeace/javascript-task-4/merges","archive_url":"https://api.github.com/repos/Zeace/javascript-task-4/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Zeace/javascript-task-4/downloads","issues_url":"https://api.github.com/repos/Zeace/javascript-task-4/issues{/number}","pulls_url":"https://api.github.com/repos/Zeace/javascript-task-4/pulls{/number}","milestones_url":"https://api.github.com/repos/Zeace/javascript-task-4/milestones{/number}","notifications_url":"https://api.github.com/repos/Zeace/javascript-task-4/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Zeace/javascript-task-4/labels{/name}","releases_url":"https://api.github.com/repos/Zeace/javascript-task-4/releases{/id}","deployments_url":"https://api.github.com/repos/Zeace/javascript-task-4/deployments","created_at":"2016-10-27T15:53:49Z","updated_at":"2016-10-27T15:53:50Z","pushed_at":"2016-10-30T17:21:30Z","git_url":"git://github.com/Zeace/javascript-task-4.git","ssh_url":"git@github.com:Zeace/javascript-task-4.git","clone_url":"https://github.com/Zeace/javascript-task-4.git","svn_url":"https://github.com/Zeace/javascript-task-4","homepage":null,"size":6,"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":"7478a115049e4e20247defea7e2f8dc6f49a8239","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":71762351,"name":"javascript-task-4","full_name":"urfu-2016/javascript-task-4","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-4","description":"Задача «Картофельная вечеринка Билли»","fork":false,"url":"https://api.github.com/repos/urfu-2016/javascript-task-4","forks_url":"https://api.github.com/repos/urfu-2016/javascript-task-4/forks","keys_url":"https://api.github.com/repos/urfu-2016/javascript-task-4/keys{/key_id}","collaborators_url":"https://api.github.com/repos/urfu-2016/javascript-task-4/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/urfu-2016/javascript-task-4/teams","hooks_url":"https://api.github.com/repos/urfu-2016/javascript-task-4/hooks","issue_events_url":"https://api.github.com/repos/urfu-2016/javascript-task-4/issues/events{/number}","events_url":"https://api.github.com/repos/urfu-2016/javascript-task-4/events","assignees_url":"https://api.github.com/repos/urfu-2016/javascript-task-4/assignees{/user}","branches_url":"https://api.github.com/repos/urfu-2016/javascript-task-4/branches{/branch}","tags_url":"https://api.github.com/repos/urfu-2016/javascript-task-4/tags","blobs_url":"https://api.github.com/repos/urfu-2016/javascript-task-4/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/urfu-2016/javascript-task-4/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/urfu-2016/javascript-task-4/git/refs{/sha}","trees_url":"https://api.github.com/repos/urfu-2016/javascript-task-4/git/trees{/sha}","statuses_url":"https://api.github.com/repos/urfu-2016/javascript-task-4/statuses/{sha}","languages_url":"https://api.github.com/repos/urfu-2016/javascript-task-4/languages","stargazers_url":"https://api.github.com/repos/urfu-2016/javascript-task-4/stargazers","contributors_url":"https://api.github.com/repos/urfu-2016/javascript-task-4/contributors","subscribers_url":"https://api.github.com/repos/urfu-2016/javascript-task-4/subscribers","subscription_url":"https://api.github.com/repos/urfu-2016/javascript-task-4/subscription","commits_url":"https://api.github.com/repos/urfu-2016/javascript-task-4/commits{/sha}","git_commits_url":"https://api.github.com/repos/urfu-2016/javascript-task-4/git/commits{/sha}","comments_url":"https://api.github.com/repos/urfu-2016/javascript-task-4/comments{/number}","issue_comment_url":"https://api.github.com/repos/urfu-2016/javascript-task-4/issues/comments{/number}","contents_url":"https://api.github.com/repos/urfu-2016/javascript-task-4/contents/{+path}","compare_url":"https://api.github.com/repos/urfu-2016/javascript-task-4/compare/{base}...{head}","merges_url":"https://api.github.com/repos/urfu-2016/javascript-task-4/merges","archive_url":"https://api.github.com/repos/urfu-2016/javascript-task-4/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/urfu-2016/javascript-task-4/downloads","issues_url":"https://api.github.com/repos/urfu-2016/javascript-task-4/issues{/number}","pulls_url":"https://api.github.com/repos/urfu-2016/javascript-task-4/pulls{/number}","milestones_url":"https://api.github.com/repos/urfu-2016/javascript-task-4/milestones{/number}","notifications_url":"https://api.github.com/repos/urfu-2016/javascript-task-4/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/urfu-2016/javascript-task-4/labels{/name}","releases_url":"https://api.github.com/repos/urfu-2016/javascript-task-4/releases{/id}","deployments_url":"https://api.github.com/repos/urfu-2016/javascript-task-4/deployments","created_at":"2016-10-24T07:19:05Z","updated_at":"2016-10-27T17:04:42Z","pushed_at":"2016-11-01T18:17:21Z","git_url":"git://github.com/urfu-2016/javascript-task-4.git","ssh_url":"git@github.com:urfu-2016/javascript-task-4.git","clone_url":"https://github.com/urfu-2016/javascript-task-4.git","svn_url":"https://github.com/urfu-2016/javascript-task-4","homepage":"","size":13,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":65,"mirror_url":null,"open_issues_count":30,"forks":65,"open_issues":30,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/urfu-2016/javascript-task-4/pulls/15"},"html":{"href":"https://github.com/urfu-2016/javascript-task-4/pull/15"},"issue":{"href":"https://api.github.com/repos/urfu-2016/javascript-task-4/issues/15"},"comments":{"href":"https://api.github.com/repos/urfu-2016/javascript-task-4/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/urfu-2016/javascript-task-4/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/urfu-2016/javascript-task-4/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/urfu-2016/javascript-task-4/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/urfu-2016/javascript-task-4/statuses/bafc611450a4d345bacb7a0f625cd6972947878f"}}}}
{"actor":{"display_login":"Lakate"}}