{"action":"created","comment":{"url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/pulls/comments/46025127","id":46025127,"diff_hunk":"@@ -1,5 +1,101 @@\n 'use strict';\n \n exports.init = function () {\n+    Object.prototype.checkContainsKeys = function (keys) {\n+        if (checkCorrectTypes(this, [Object.prototype, Array.prototype])) {\n+            var result = true;\n+            keys.forEach(function (key) {\n+                if (!(this.hasOwnProperty(key))) {\n+                    result = false;\n+                }\n+            }, this);\n+            return result;\n+        }\n+    },\n+\n+    Object.prototype.checkHasKeys = function (keys) {\n+        if (checkCorrectTypes(this, [Object.prototype, Array.prototype])) {\n+            if (keys.length != Object.keys(this).length) {\n+                return false;\n+            }\n+            var localKeys = [];\n+            for (var key in this) {\n+                if (this.hasOwnProperty(key)) {\n+                    localKeys.push(key);\n+                }\n+            }\n+            keys.forEach(function (key) {\n+                if (localKeys.indexOf(key) < 0) {\n+                    return false;\n+                }\n+            });\n+            return true;\n+        }\n+    },\n+\n+    Object.prototype.checkContainsValues = function (values) {\n+        if (checkCorrectTypes(this, [Object.prototype, Array.prototype])) {\n+            var thisValues = [];\n+            Object.keys(this).forEach(function (key) {\n+                thisValues.push(this[key]);\n+            }, this);\n+            var result = true;\n+            values.forEach(function (value) {\n+                if (thisValues.indexOf(value) < 0) {\n+                    result = false;\n+                }\n+            });\n+            return result;\n+        }\n+    },\n+\n+    Object.prototype.checkHasValues = function (values) {\n+        if (checkCorrectTypes(this, [Object.prototype, Array.prototype])) {\n+            var result = true;\n+            Object.keys.forEach(function (key) {\n+                if (values.indexOf(this[key]) < 0) {\n+                    result = false;\n+                }\n+            }, this);\n+            return result;\n+        }\n+    },\n+\n+    Object.prototype.checkHasValueType = function (key, type) {\n+        if (checkCorrectTypes(this, [Object.prototype, Array.prototype])) {\n+            var types = [Number, Function, Array, String];\n+            if (types.indexOf(type) < 0) {\n+                return false;\n+            }\n+            return this[key] === type(this[key]);","path":"src/check.js","position":null,"original_position":70,"commit_id":"fb44b8ed42818f2d542f50ae7d98343a9dfee0b6","original_commit_id":"d3c2bb7bd70e02ed29b0289ba30c0353950f6b36","user":{"login":"FrodoTheTrue","id":9107905,"avatar_url":"https://avatars.githubusercontent.com/u/9107905?v=3","gravatar_id":"","url":"https://api.github.com/users/FrodoTheTrue","html_url":"https://github.com/FrodoTheTrue","followers_url":"https://api.github.com/users/FrodoTheTrue/followers","following_url":"https://api.github.com/users/FrodoTheTrue/following{/other_user}","gists_url":"https://api.github.com/users/FrodoTheTrue/gists{/gist_id}","starred_url":"https://api.github.com/users/FrodoTheTrue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FrodoTheTrue/subscriptions","organizations_url":"https://api.github.com/users/FrodoTheTrue/orgs","repos_url":"https://api.github.com/users/FrodoTheTrue/repos","events_url":"https://api.github.com/users/FrodoTheTrue/events{/privacy}","received_events_url":"https://api.github.com/users/FrodoTheTrue/received_events","type":"User","site_admin":false},"body":"@vaseker, я поправил, но тест из за этого сломался\r\nон сравнивает function и string","created_at":"2015-11-27T08:19:09Z","updated_at":"2015-11-27T08:19:09Z","html_url":"https://github.com/urfu-2015/javascript-tasks-7/pull/30#discussion_r46025127","pull_request_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/pulls/30","_links":{"self":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/pulls/comments/46025127"},"html":{"href":"https://github.com/urfu-2015/javascript-tasks-7/pull/30#discussion_r46025127"},"pull_request":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/pulls/30"}}},"pull_request":{"url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/pulls/30","id":50841861,"html_url":"https://github.com/urfu-2015/javascript-tasks-7/pull/30","diff_url":"https://github.com/urfu-2015/javascript-tasks-7/pull/30.diff","patch_url":"https://github.com/urfu-2015/javascript-tasks-7/pull/30.patch","issue_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/issues/30","number":30,"state":"open","locked":false,"title":"Исаков Федор","user":{"login":"FrodoTheTrue","id":9107905,"avatar_url":"https://avatars.githubusercontent.com/u/9107905?v=3","gravatar_id":"","url":"https://api.github.com/users/FrodoTheTrue","html_url":"https://github.com/FrodoTheTrue","followers_url":"https://api.github.com/users/FrodoTheTrue/followers","following_url":"https://api.github.com/users/FrodoTheTrue/following{/other_user}","gists_url":"https://api.github.com/users/FrodoTheTrue/gists{/gist_id}","starred_url":"https://api.github.com/users/FrodoTheTrue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FrodoTheTrue/subscriptions","organizations_url":"https://api.github.com/users/FrodoTheTrue/orgs","repos_url":"https://api.github.com/users/FrodoTheTrue/repos","events_url":"https://api.github.com/users/FrodoTheTrue/events{/privacy}","received_events_url":"https://api.github.com/users/FrodoTheTrue/received_events","type":"User","site_admin":false},"body":"init","created_at":"2015-11-16T17:44:00Z","updated_at":"2015-11-27T08:19:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8ca899a215d72d3fc847d894bf10ce9ef73c1b8f","assignee":{"login":"vaseker","id":1942271,"avatar_url":"https://avatars.githubusercontent.com/u/1942271?v=3","gravatar_id":"","url":"https://api.github.com/users/vaseker","html_url":"https://github.com/vaseker","followers_url":"https://api.github.com/users/vaseker/followers","following_url":"https://api.github.com/users/vaseker/following{/other_user}","gists_url":"https://api.github.com/users/vaseker/gists{/gist_id}","starred_url":"https://api.github.com/users/vaseker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vaseker/subscriptions","organizations_url":"https://api.github.com/users/vaseker/orgs","repos_url":"https://api.github.com/users/vaseker/repos","events_url":"https://api.github.com/users/vaseker/events{/privacy}","received_events_url":"https://api.github.com/users/vaseker/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/pulls/30/commits","review_comments_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/pulls/30/comments","review_comment_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/pulls/comments{/number}","comments_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/issues/30/comments","statuses_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/statuses/fb44b8ed42818f2d542f50ae7d98343a9dfee0b6","head":{"label":"FrodoTheTrue:master","ref":"master","sha":"fb44b8ed42818f2d542f50ae7d98343a9dfee0b6","user":{"login":"FrodoTheTrue","id":9107905,"avatar_url":"https://avatars.githubusercontent.com/u/9107905?v=3","gravatar_id":"","url":"https://api.github.com/users/FrodoTheTrue","html_url":"https://github.com/FrodoTheTrue","followers_url":"https://api.github.com/users/FrodoTheTrue/followers","following_url":"https://api.github.com/users/FrodoTheTrue/following{/other_user}","gists_url":"https://api.github.com/users/FrodoTheTrue/gists{/gist_id}","starred_url":"https://api.github.com/users/FrodoTheTrue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FrodoTheTrue/subscriptions","organizations_url":"https://api.github.com/users/FrodoTheTrue/orgs","repos_url":"https://api.github.com/users/FrodoTheTrue/repos","events_url":"https://api.github.com/users/FrodoTheTrue/events{/privacy}","received_events_url":"https://api.github.com/users/FrodoTheTrue/received_events","type":"User","site_admin":false},"repo":{"id":46220371,"name":"javascript-tasks-7","full_name":"FrodoTheTrue/javascript-tasks-7","owner":{"login":"FrodoTheTrue","id":9107905,"avatar_url":"https://avatars.githubusercontent.com/u/9107905?v=3","gravatar_id":"","url":"https://api.github.com/users/FrodoTheTrue","html_url":"https://github.com/FrodoTheTrue","followers_url":"https://api.github.com/users/FrodoTheTrue/followers","following_url":"https://api.github.com/users/FrodoTheTrue/following{/other_user}","gists_url":"https://api.github.com/users/FrodoTheTrue/gists{/gist_id}","starred_url":"https://api.github.com/users/FrodoTheTrue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FrodoTheTrue/subscriptions","organizations_url":"https://api.github.com/users/FrodoTheTrue/orgs","repos_url":"https://api.github.com/users/FrodoTheTrue/repos","events_url":"https://api.github.com/users/FrodoTheTrue/events{/privacy}","received_events_url":"https://api.github.com/users/FrodoTheTrue/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/FrodoTheTrue/javascript-tasks-7","description":"Задача к лекции «Прототипы»","fork":true,"url":"https://api.github.com/repos/FrodoTheTrue/javascript-tasks-7","forks_url":"https://api.github.com/repos/FrodoTheTrue/javascript-tasks-7/forks","keys_url":"https://api.github.com/repos/FrodoTheTrue/javascript-tasks-7/keys{/key_id}","collaborators_url":"https://api.github.com/repos/FrodoTheTrue/javascript-tasks-7/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/FrodoTheTrue/javascript-tasks-7/teams","hooks_url":"https://api.github.com/repos/FrodoTheTrue/javascript-tasks-7/hooks","issue_events_url":"https://api.github.com/repos/FrodoTheTrue/javascript-tasks-7/issues/events{/number}","events_url":"https://api.github.com/repos/FrodoTheTrue/javascript-tasks-7/events","assignees_url":"https://api.github.com/repos/FrodoTheTrue/javascript-tasks-7/assignees{/user}","branches_url":"https://api.github.com/repos/FrodoTheTrue/javascript-tasks-7/branches{/branch}","tags_url":"https://api.github.com/repos/FrodoTheTrue/javascript-tasks-7/tags","blobs_url":"https://api.github.com/repos/FrodoTheTrue/javascript-tasks-7/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/FrodoTheTrue/javascript-tasks-7/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/FrodoTheTrue/javascript-tasks-7/git/refs{/sha}","trees_url":"https://api.github.com/repos/FrodoTheTrue/javascript-tasks-7/git/trees{/sha}","statuses_url":"https://api.github.com/repos/FrodoTheTrue/javascript-tasks-7/statuses/{sha}","languages_url":"https://api.github.com/repos/FrodoTheTrue/javascript-tasks-7/languages","stargazers_url":"https://api.github.com/repos/FrodoTheTrue/javascript-tasks-7/stargazers","contributors_url":"https://api.github.com/repos/FrodoTheTrue/javascript-tasks-7/contributors","subscribers_url":"https://api.github.com/repos/FrodoTheTrue/javascript-tasks-7/subscribers","subscription_url":"https://api.github.com/repos/FrodoTheTrue/javascript-tasks-7/subscription","commits_url":"https://api.github.com/repos/FrodoTheTrue/javascript-tasks-7/commits{/sha}","git_commits_url":"https://api.github.com/repos/FrodoTheTrue/javascript-tasks-7/git/commits{/sha}","comments_url":"https://api.github.com/repos/FrodoTheTrue/javascript-tasks-7/comments{/number}","issue_comment_url":"https://api.github.com/repos/FrodoTheTrue/javascript-tasks-7/issues/comments{/number}","contents_url":"https://api.github.com/repos/FrodoTheTrue/javascript-tasks-7/contents/{+path}","compare_url":"https://api.github.com/repos/FrodoTheTrue/javascript-tasks-7/compare/{base}...{head}","merges_url":"https://api.github.com/repos/FrodoTheTrue/javascript-tasks-7/merges","archive_url":"https://api.github.com/repos/FrodoTheTrue/javascript-tasks-7/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/FrodoTheTrue/javascript-tasks-7/downloads","issues_url":"https://api.github.com/repos/FrodoTheTrue/javascript-tasks-7/issues{/number}","pulls_url":"https://api.github.com/repos/FrodoTheTrue/javascript-tasks-7/pulls{/number}","milestones_url":"https://api.github.com/repos/FrodoTheTrue/javascript-tasks-7/milestones{/number}","notifications_url":"https://api.github.com/repos/FrodoTheTrue/javascript-tasks-7/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/FrodoTheTrue/javascript-tasks-7/labels{/name}","releases_url":"https://api.github.com/repos/FrodoTheTrue/javascript-tasks-7/releases{/id}","created_at":"2015-11-15T14:16:40Z","updated_at":"2015-11-15T14:16:41Z","pushed_at":"2015-11-27T08:13:19Z","git_url":"git://github.com/FrodoTheTrue/javascript-tasks-7.git","ssh_url":"git@github.com:FrodoTheTrue/javascript-tasks-7.git","clone_url":"https://github.com/FrodoTheTrue/javascript-tasks-7.git","svn_url":"https://github.com/FrodoTheTrue/javascript-tasks-7","homepage":"","size":10,"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":"fc0b1e2ad14a21f600f4ee446dff7717716aa059","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":45921264,"name":"javascript-tasks-7","full_name":"urfu-2015/javascript-tasks-7","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-7","description":"Задача к лекции «Прототипы»","fork":false,"url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7","forks_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/forks","keys_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/keys{/key_id}","collaborators_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/teams","hooks_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/hooks","issue_events_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/issues/events{/number}","events_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/events","assignees_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/assignees{/user}","branches_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/branches{/branch}","tags_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/tags","blobs_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/git/refs{/sha}","trees_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/git/trees{/sha}","statuses_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/statuses/{sha}","languages_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/languages","stargazers_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/stargazers","contributors_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/contributors","subscribers_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/subscribers","subscription_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/subscription","commits_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/commits{/sha}","git_commits_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/git/commits{/sha}","comments_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/comments{/number}","issue_comment_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/issues/comments{/number}","contents_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/contents/{+path}","compare_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/compare/{base}...{head}","merges_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/merges","archive_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/downloads","issues_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/issues{/number}","pulls_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/pulls{/number}","milestones_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/milestones{/number}","notifications_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/labels{/name}","releases_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/releases{/id}","created_at":"2015-11-10T15:32:46Z","updated_at":"2015-11-10T15:50:17Z","pushed_at":"2015-11-27T08:13:21Z","git_url":"git://github.com/urfu-2015/javascript-tasks-7.git","ssh_url":"git@github.com:urfu-2015/javascript-tasks-7.git","clone_url":"https://github.com/urfu-2015/javascript-tasks-7.git","svn_url":"https://github.com/urfu-2015/javascript-tasks-7","homepage":"","size":0,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":46,"mirror_url":null,"open_issues_count":17,"forks":46,"open_issues":17,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/pulls/30"},"html":{"href":"https://github.com/urfu-2015/javascript-tasks-7/pull/30"},"issue":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/issues/30"},"comments":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/issues/30/comments"},"review_comments":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/pulls/30/comments"},"review_comment":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/pulls/30/commits"},"statuses":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-7/statuses/fb44b8ed42818f2d542f50ae7d98343a9dfee0b6"}}}}