{"action":"created","comment":{"url":"https://api.github.com/repos/DenisBelkin/social_network/pulls/comments/197373275","pull_request_review_id":131105154,"id":197373275,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NzM3MzI3NQ==","diff_hunk":"@@ -0,0 +1,89 @@\n+class Validations {\n+    constructor() {\n+\n+    }\n+\n+    static typeOfRegexp(content, type) {\n+        switch (type) {\n+            case 'name':\n+                return Validations.regexpName(content);\n+            case 'email':\n+                return Validations.regexpEmail(content);\n+            case 'gender':\n+                return Validations.regexpGender(content);\n+            case 'age':\n+                return Validations.regExpAge(content);\n+        }\n+    }\n+\n+    static validateForm(props) {\n+        console.log('PROPS', props);\n+        for (let i in props) {\n+            if (props[i] !== props.middleName && !props[i].isValid) {\n+                return false;\n+            }\n+\n+        }\n+\n+        if (!props.middleName.isValid && !props.middleName.content) {\n+            return true;\n+        } else if (!props.middleName.isValid && props.middleName.content) {\n+            return false;\n+        } else {\n+            return true;\n+        }\n+    }\n+\n+    static regexpImage(img) {\n+\n+        const imgPath = img.value;\n+        const validImageExtensions = /(\\.jpg|\\.jpeg|\\.png|\\.bmp)$/i;\n+\n+        if (!validImageExtensions.exec(imgPath)) {\n+            console.log('bad file');\n+            return false;\n+        } else {\n+            console.log('it is image');\n+\n+            if (img.files && img.files[0]) {\n+                if (img.files[0].size >= 40000 && img.files[0].size <= 5120000) {\n+                    console.log('size ok');\n+                    return true;\n+                } else {\n+                    console.log('invalid size');\n+                }\n+\n+\n+            }\n+        }\n+\n+    }\n+\n+    static regexpName(name) {\n+        let pattern = /^[A-Z][a-z]{1,32}$/;\n+        return pattern.test(name);\n+    };\n+\n+\n+    static regexpEmail(email) {\n+        let pattern = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n+        return pattern.test(String(email).toLowerCase());\n+    };\n+\n+    static regexpGender(gender) {\n+        if (gender) {\n+            return true;\n+        }\n+    }\n+\n+    static regExpAge(age) {\n+        if (age >= 1 && age <= 99) {","path":"app/src/common/Validations.js","position":80,"original_position":80,"commit_id":"b44391f417de62d618e02a1bf0fae051038d9202","original_commit_id":"b44391f417de62d618e02a1bf0fae051038d9202","user":{"login":"sturchaninov","id":5379984,"node_id":"MDQ6VXNlcjUzNzk5ODQ=","avatar_url":"https://avatars2.githubusercontent.com/u/5379984?v=4","gravatar_id":"","url":"https://api.github.com/users/sturchaninov","html_url":"https://github.com/sturchaninov","followers_url":"https://api.github.com/users/sturchaninov/followers","following_url":"https://api.github.com/users/sturchaninov/following{/other_user}","gists_url":"https://api.github.com/users/sturchaninov/gists{/gist_id}","starred_url":"https://api.github.com/users/sturchaninov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sturchaninov/subscriptions","organizations_url":"https://api.github.com/users/sturchaninov/orgs","repos_url":"https://api.github.com/users/sturchaninov/repos","events_url":"https://api.github.com/users/sturchaninov/events{/privacy}","received_events_url":"https://api.github.com/users/sturchaninov/received_events","type":"User","site_admin":false},"body":"move limits to constants","created_at":"2018-06-22T08:22:37Z","updated_at":"2018-06-22T08:22:37Z","html_url":"https://github.com/DenisBelkin/social_network/pull/1#discussion_r197373275","pull_request_url":"https://api.github.com/repos/DenisBelkin/social_network/pulls/1","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/DenisBelkin/social_network/pulls/comments/197373275"},"html":{"href":"https://github.com/DenisBelkin/social_network/pull/1#discussion_r197373275"},"pull_request":{"href":"https://api.github.com/repos/DenisBelkin/social_network/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/DenisBelkin/social_network/pulls/1","id":196024014,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk2MDI0MDE0","html_url":"https://github.com/DenisBelkin/social_network/pull/1","diff_url":"https://github.com/DenisBelkin/social_network/pull/1.diff","patch_url":"https://github.com/DenisBelkin/social_network/pull/1.patch","issue_url":"https://api.github.com/repos/DenisBelkin/social_network/issues/1","number":1,"state":"open","locked":false,"title":"Form sign up","user":{"login":"DenisBelkin","id":33394067,"node_id":"MDQ6VXNlcjMzMzk0MDY3","avatar_url":"https://avatars2.githubusercontent.com/u/33394067?v=4","gravatar_id":"","url":"https://api.github.com/users/DenisBelkin","html_url":"https://github.com/DenisBelkin","followers_url":"https://api.github.com/users/DenisBelkin/followers","following_url":"https://api.github.com/users/DenisBelkin/following{/other_user}","gists_url":"https://api.github.com/users/DenisBelkin/gists{/gist_id}","starred_url":"https://api.github.com/users/DenisBelkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DenisBelkin/subscriptions","organizations_url":"https://api.github.com/users/DenisBelkin/orgs","repos_url":"https://api.github.com/users/DenisBelkin/repos","events_url":"https://api.github.com/users/DenisBelkin/events{/privacy}","received_events_url":"https://api.github.com/users/DenisBelkin/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-06-20T05:15:44Z","updated_at":"2018-06-22T08:22:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"104ceedefc6f2ce7a5c9561ea4d4419dc8b2a38f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/DenisBelkin/social_network/pulls/1/commits","review_comments_url":"https://api.github.com/repos/DenisBelkin/social_network/pulls/1/comments","review_comment_url":"https://api.github.com/repos/DenisBelkin/social_network/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DenisBelkin/social_network/issues/1/comments","statuses_url":"https://api.github.com/repos/DenisBelkin/social_network/statuses/b44391f417de62d618e02a1bf0fae051038d9202","head":{"label":"DenisBelkin:formSignUp","ref":"formSignUp","sha":"b44391f417de62d618e02a1bf0fae051038d9202","user":{"login":"DenisBelkin","id":33394067,"node_id":"MDQ6VXNlcjMzMzk0MDY3","avatar_url":"https://avatars2.githubusercontent.com/u/33394067?v=4","gravatar_id":"","url":"https://api.github.com/users/DenisBelkin","html_url":"https://github.com/DenisBelkin","followers_url":"https://api.github.com/users/DenisBelkin/followers","following_url":"https://api.github.com/users/DenisBelkin/following{/other_user}","gists_url":"https://api.github.com/users/DenisBelkin/gists{/gist_id}","starred_url":"https://api.github.com/users/DenisBelkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DenisBelkin/subscriptions","organizations_url":"https://api.github.com/users/DenisBelkin/orgs","repos_url":"https://api.github.com/users/DenisBelkin/repos","events_url":"https://api.github.com/users/DenisBelkin/events{/privacy}","received_events_url":"https://api.github.com/users/DenisBelkin/received_events","type":"User","site_admin":false},"repo":{"id":137049144,"node_id":"MDEwOlJlcG9zaXRvcnkxMzcwNDkxNDQ=","name":"social_network","full_name":"DenisBelkin/social_network","owner":{"login":"DenisBelkin","id":33394067,"node_id":"MDQ6VXNlcjMzMzk0MDY3","avatar_url":"https://avatars2.githubusercontent.com/u/33394067?v=4","gravatar_id":"","url":"https://api.github.com/users/DenisBelkin","html_url":"https://github.com/DenisBelkin","followers_url":"https://api.github.com/users/DenisBelkin/followers","following_url":"https://api.github.com/users/DenisBelkin/following{/other_user}","gists_url":"https://api.github.com/users/DenisBelkin/gists{/gist_id}","starred_url":"https://api.github.com/users/DenisBelkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DenisBelkin/subscriptions","organizations_url":"https://api.github.com/users/DenisBelkin/orgs","repos_url":"https://api.github.com/users/DenisBelkin/repos","events_url":"https://api.github.com/users/DenisBelkin/events{/privacy}","received_events_url":"https://api.github.com/users/DenisBelkin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DenisBelkin/social_network","description":null,"fork":false,"url":"https://api.github.com/repos/DenisBelkin/social_network","forks_url":"https://api.github.com/repos/DenisBelkin/social_network/forks","keys_url":"https://api.github.com/repos/DenisBelkin/social_network/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DenisBelkin/social_network/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DenisBelkin/social_network/teams","hooks_url":"https://api.github.com/repos/DenisBelkin/social_network/hooks","issue_events_url":"https://api.github.com/repos/DenisBelkin/social_network/issues/events{/number}","events_url":"https://api.github.com/repos/DenisBelkin/social_network/events","assignees_url":"https://api.github.com/repos/DenisBelkin/social_network/assignees{/user}","branches_url":"https://api.github.com/repos/DenisBelkin/social_network/branches{/branch}","tags_url":"https://api.github.com/repos/DenisBelkin/social_network/tags","blobs_url":"https://api.github.com/repos/DenisBelkin/social_network/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DenisBelkin/social_network/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DenisBelkin/social_network/git/refs{/sha}","trees_url":"https://api.github.com/repos/DenisBelkin/social_network/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DenisBelkin/social_network/statuses/{sha}","languages_url":"https://api.github.com/repos/DenisBelkin/social_network/languages","stargazers_url":"https://api.github.com/repos/DenisBelkin/social_network/stargazers","contributors_url":"https://api.github.com/repos/DenisBelkin/social_network/contributors","subscribers_url":"https://api.github.com/repos/DenisBelkin/social_network/subscribers","subscription_url":"https://api.github.com/repos/DenisBelkin/social_network/subscription","commits_url":"https://api.github.com/repos/DenisBelkin/social_network/commits{/sha}","git_commits_url":"https://api.github.com/repos/DenisBelkin/social_network/git/commits{/sha}","comments_url":"https://api.github.com/repos/DenisBelkin/social_network/comments{/number}","issue_comment_url":"https://api.github.com/repos/DenisBelkin/social_network/issues/comments{/number}","contents_url":"https://api.github.com/repos/DenisBelkin/social_network/contents/{+path}","compare_url":"https://api.github.com/repos/DenisBelkin/social_network/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DenisBelkin/social_network/merges","archive_url":"https://api.github.com/repos/DenisBelkin/social_network/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DenisBelkin/social_network/downloads","issues_url":"https://api.github.com/repos/DenisBelkin/social_network/issues{/number}","pulls_url":"https://api.github.com/repos/DenisBelkin/social_network/pulls{/number}","milestones_url":"https://api.github.com/repos/DenisBelkin/social_network/milestones{/number}","notifications_url":"https://api.github.com/repos/DenisBelkin/social_network/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DenisBelkin/social_network/labels{/name}","releases_url":"https://api.github.com/repos/DenisBelkin/social_network/releases{/id}","deployments_url":"https://api.github.com/repos/DenisBelkin/social_network/deployments","created_at":"2018-06-12T09:31:14Z","updated_at":"2018-06-12T14:18:34Z","pushed_at":"2018-06-22T06:42:45Z","git_url":"git://github.com/DenisBelkin/social_network.git","ssh_url":"git@github.com:DenisBelkin/social_network.git","clone_url":"https://github.com/DenisBelkin/social_network.git","svn_url":"https://github.com/DenisBelkin/social_network","homepage":null,"size":629,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"DenisBelkin:master","ref":"master","sha":"78dc8bd97214a97191036d98e00c1db1a1c3f11e","user":{"login":"DenisBelkin","id":33394067,"node_id":"MDQ6VXNlcjMzMzk0MDY3","avatar_url":"https://avatars2.githubusercontent.com/u/33394067?v=4","gravatar_id":"","url":"https://api.github.com/users/DenisBelkin","html_url":"https://github.com/DenisBelkin","followers_url":"https://api.github.com/users/DenisBelkin/followers","following_url":"https://api.github.com/users/DenisBelkin/following{/other_user}","gists_url":"https://api.github.com/users/DenisBelkin/gists{/gist_id}","starred_url":"https://api.github.com/users/DenisBelkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DenisBelkin/subscriptions","organizations_url":"https://api.github.com/users/DenisBelkin/orgs","repos_url":"https://api.github.com/users/DenisBelkin/repos","events_url":"https://api.github.com/users/DenisBelkin/events{/privacy}","received_events_url":"https://api.github.com/users/DenisBelkin/received_events","type":"User","site_admin":false},"repo":{"id":137049144,"node_id":"MDEwOlJlcG9zaXRvcnkxMzcwNDkxNDQ=","name":"social_network","full_name":"DenisBelkin/social_network","owner":{"login":"DenisBelkin","id":33394067,"node_id":"MDQ6VXNlcjMzMzk0MDY3","avatar_url":"https://avatars2.githubusercontent.com/u/33394067?v=4","gravatar_id":"","url":"https://api.github.com/users/DenisBelkin","html_url":"https://github.com/DenisBelkin","followers_url":"https://api.github.com/users/DenisBelkin/followers","following_url":"https://api.github.com/users/DenisBelkin/following{/other_user}","gists_url":"https://api.github.com/users/DenisBelkin/gists{/gist_id}","starred_url":"https://api.github.com/users/DenisBelkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DenisBelkin/subscriptions","organizations_url":"https://api.github.com/users/DenisBelkin/orgs","repos_url":"https://api.github.com/users/DenisBelkin/repos","events_url":"https://api.github.com/users/DenisBelkin/events{/privacy}","received_events_url":"https://api.github.com/users/DenisBelkin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DenisBelkin/social_network","description":null,"fork":false,"url":"https://api.github.com/repos/DenisBelkin/social_network","forks_url":"https://api.github.com/repos/DenisBelkin/social_network/forks","keys_url":"https://api.github.com/repos/DenisBelkin/social_network/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DenisBelkin/social_network/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DenisBelkin/social_network/teams","hooks_url":"https://api.github.com/repos/DenisBelkin/social_network/hooks","issue_events_url":"https://api.github.com/repos/DenisBelkin/social_network/issues/events{/number}","events_url":"https://api.github.com/repos/DenisBelkin/social_network/events","assignees_url":"https://api.github.com/repos/DenisBelkin/social_network/assignees{/user}","branches_url":"https://api.github.com/repos/DenisBelkin/social_network/branches{/branch}","tags_url":"https://api.github.com/repos/DenisBelkin/social_network/tags","blobs_url":"https://api.github.com/repos/DenisBelkin/social_network/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DenisBelkin/social_network/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DenisBelkin/social_network/git/refs{/sha}","trees_url":"https://api.github.com/repos/DenisBelkin/social_network/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DenisBelkin/social_network/statuses/{sha}","languages_url":"https://api.github.com/repos/DenisBelkin/social_network/languages","stargazers_url":"https://api.github.com/repos/DenisBelkin/social_network/stargazers","contributors_url":"https://api.github.com/repos/DenisBelkin/social_network/contributors","subscribers_url":"https://api.github.com/repos/DenisBelkin/social_network/subscribers","subscription_url":"https://api.github.com/repos/DenisBelkin/social_network/subscription","commits_url":"https://api.github.com/repos/DenisBelkin/social_network/commits{/sha}","git_commits_url":"https://api.github.com/repos/DenisBelkin/social_network/git/commits{/sha}","comments_url":"https://api.github.com/repos/DenisBelkin/social_network/comments{/number}","issue_comment_url":"https://api.github.com/repos/DenisBelkin/social_network/issues/comments{/number}","contents_url":"https://api.github.com/repos/DenisBelkin/social_network/contents/{+path}","compare_url":"https://api.github.com/repos/DenisBelkin/social_network/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DenisBelkin/social_network/merges","archive_url":"https://api.github.com/repos/DenisBelkin/social_network/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DenisBelkin/social_network/downloads","issues_url":"https://api.github.com/repos/DenisBelkin/social_network/issues{/number}","pulls_url":"https://api.github.com/repos/DenisBelkin/social_network/pulls{/number}","milestones_url":"https://api.github.com/repos/DenisBelkin/social_network/milestones{/number}","notifications_url":"https://api.github.com/repos/DenisBelkin/social_network/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DenisBelkin/social_network/labels{/name}","releases_url":"https://api.github.com/repos/DenisBelkin/social_network/releases{/id}","deployments_url":"https://api.github.com/repos/DenisBelkin/social_network/deployments","created_at":"2018-06-12T09:31:14Z","updated_at":"2018-06-12T14:18:34Z","pushed_at":"2018-06-22T06:42:45Z","git_url":"git://github.com/DenisBelkin/social_network.git","ssh_url":"git@github.com:DenisBelkin/social_network.git","clone_url":"https://github.com/DenisBelkin/social_network.git","svn_url":"https://github.com/DenisBelkin/social_network","homepage":null,"size":629,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DenisBelkin/social_network/pulls/1"},"html":{"href":"https://github.com/DenisBelkin/social_network/pull/1"},"issue":{"href":"https://api.github.com/repos/DenisBelkin/social_network/issues/1"},"comments":{"href":"https://api.github.com/repos/DenisBelkin/social_network/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/DenisBelkin/social_network/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/DenisBelkin/social_network/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DenisBelkin/social_network/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/DenisBelkin/social_network/statuses/b44391f417de62d618e02a1bf0fae051038d9202"}},"author_association":"OWNER"}}
{"actor":{"display_login":"sturchaninov"}}