{"action":"created","comment":{"url":"https://api.github.com/repos/sourcelair/env-spec-js/pulls/comments/204354337","pull_request_review_id":139415839,"id":204354337,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNDM1NDMzNw==","diff_hunk":"@@ -1,29 +1,51 @@\n //function that checks if the env value is valid\n //value cannot start with a digit and must only contain alphanumeric characters or an underscore\n const checkValidationOfValues = envSpecString => {\n+  const validValues = ['color','date','datetime-local','email','month','number','password','tel','text','time','url','week','default'];\n   const alphanumericThatDoesNotStartWithDigit = /^[A-Z_][0-9A-Z_]*$/;\n-  let envValuesChecked = envSpecString.split(\"\\n\"); //split lines based on \\n character\n+  let envValArray = parseVarFromVal(envSpecString.split(\"\\n\")); //split lines based on \\n character and parse them\n \n-  return (envValuesChecked = envValuesChecked.filter(element => {\n-    return element.match(alphanumericThatDoesNotStartWithDigit); //keep valid values\n-  }));\n+  return envValArray = envValArray.filter( element =>{ //check for valid variables AND values\n+    if(element[0].match(alphanumericThatDoesNotStartWithDigit)&&(validValues.includes(element[1]))){\n+      return element;\n+    }\n+  })\n };\n \n+//function that separates the variables from their values and returns them as separated arrays","path":"src/main.js","position":19,"original_position":19,"commit_id":"7e53681b820ebb21f63fdbce660db15f540903d5","original_commit_id":"7e53681b820ebb21f63fdbce660db15f540903d5","user":{"login":"parisk","id":1188592,"node_id":"MDQ6VXNlcjExODg1OTI=","avatar_url":"https://avatars3.githubusercontent.com/u/1188592?v=4","gravatar_id":"","url":"https://api.github.com/users/parisk","html_url":"https://github.com/parisk","followers_url":"https://api.github.com/users/parisk/followers","following_url":"https://api.github.com/users/parisk/following{/other_user}","gists_url":"https://api.github.com/users/parisk/gists{/gist_id}","starred_url":"https://api.github.com/users/parisk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/parisk/subscriptions","organizations_url":"https://api.github.com/users/parisk/orgs","repos_url":"https://api.github.com/users/parisk/repos","events_url":"https://api.github.com/users/parisk/events{/privacy}","received_events_url":"https://api.github.com/users/parisk/received_events","type":"User","site_admin":false},"body":"> separates the variables from their values\r\n\r\nI guess the appropriate wording here is; _separates the variables from their **types**_","created_at":"2018-07-23T10:34:16Z","updated_at":"2018-07-23T10:38:41Z","html_url":"https://github.com/sourcelair/env-spec-js/pull/6#discussion_r204354337","pull_request_url":"https://api.github.com/repos/sourcelair/env-spec-js/pulls/6","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/sourcelair/env-spec-js/pulls/comments/204354337"},"html":{"href":"https://github.com/sourcelair/env-spec-js/pull/6#discussion_r204354337"},"pull_request":{"href":"https://api.github.com/repos/sourcelair/env-spec-js/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/sourcelair/env-spec-js/pulls/6","id":202823663,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAyODIzNjYz","html_url":"https://github.com/sourcelair/env-spec-js/pull/6","diff_url":"https://github.com/sourcelair/env-spec-js/pull/6.diff","patch_url":"https://github.com/sourcelair/env-spec-js/pull/6.patch","issue_url":"https://api.github.com/repos/sourcelair/env-spec-js/issues/6","number":6,"state":"open","locked":false,"title":"Syntax types","user":{"login":"akanellop","id":24398390,"node_id":"MDQ6VXNlcjI0Mzk4Mzkw","avatar_url":"https://avatars1.githubusercontent.com/u/24398390?v=4","gravatar_id":"","url":"https://api.github.com/users/akanellop","html_url":"https://github.com/akanellop","followers_url":"https://api.github.com/users/akanellop/followers","following_url":"https://api.github.com/users/akanellop/following{/other_user}","gists_url":"https://api.github.com/users/akanellop/gists{/gist_id}","starred_url":"https://api.github.com/users/akanellop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akanellop/subscriptions","organizations_url":"https://api.github.com/users/akanellop/orgs","repos_url":"https://api.github.com/users/akanellop/repos","events_url":"https://api.github.com/users/akanellop/events{/privacy}","received_events_url":"https://api.github.com/users/akanellop/received_events","type":"User","site_admin":false},"body":"separation of values from the env variables \r\nvalidation checking of types' value\r\nimplementation of tests for the above","created_at":"2018-07-20T11:35:31Z","updated_at":"2018-07-23T10:38:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7e17d12aa26017fd6556c5366c5f243af9c5edec","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/sourcelair/env-spec-js/pulls/6/commits","review_comments_url":"https://api.github.com/repos/sourcelair/env-spec-js/pulls/6/comments","review_comment_url":"https://api.github.com/repos/sourcelair/env-spec-js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sourcelair/env-spec-js/issues/6/comments","statuses_url":"https://api.github.com/repos/sourcelair/env-spec-js/statuses/7e53681b820ebb21f63fdbce660db15f540903d5","head":{"label":"akanellop:syntax-types","ref":"syntax-types","sha":"7e53681b820ebb21f63fdbce660db15f540903d5","user":{"login":"akanellop","id":24398390,"node_id":"MDQ6VXNlcjI0Mzk4Mzkw","avatar_url":"https://avatars1.githubusercontent.com/u/24398390?v=4","gravatar_id":"","url":"https://api.github.com/users/akanellop","html_url":"https://github.com/akanellop","followers_url":"https://api.github.com/users/akanellop/followers","following_url":"https://api.github.com/users/akanellop/following{/other_user}","gists_url":"https://api.github.com/users/akanellop/gists{/gist_id}","starred_url":"https://api.github.com/users/akanellop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akanellop/subscriptions","organizations_url":"https://api.github.com/users/akanellop/orgs","repos_url":"https://api.github.com/users/akanellop/repos","events_url":"https://api.github.com/users/akanellop/events{/privacy}","received_events_url":"https://api.github.com/users/akanellop/received_events","type":"User","site_admin":false},"repo":{"id":141123832,"node_id":"MDEwOlJlcG9zaXRvcnkxNDExMjM4MzI=","name":"env-spec-js","full_name":"akanellop/env-spec-js","owner":{"login":"akanellop","id":24398390,"node_id":"MDQ6VXNlcjI0Mzk4Mzkw","avatar_url":"https://avatars1.githubusercontent.com/u/24398390?v=4","gravatar_id":"","url":"https://api.github.com/users/akanellop","html_url":"https://github.com/akanellop","followers_url":"https://api.github.com/users/akanellop/followers","following_url":"https://api.github.com/users/akanellop/following{/other_user}","gists_url":"https://api.github.com/users/akanellop/gists{/gist_id}","starred_url":"https://api.github.com/users/akanellop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akanellop/subscriptions","organizations_url":"https://api.github.com/users/akanellop/orgs","repos_url":"https://api.github.com/users/akanellop/repos","events_url":"https://api.github.com/users/akanellop/events{/privacy}","received_events_url":"https://api.github.com/users/akanellop/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/akanellop/env-spec-js","description":null,"fork":true,"url":"https://api.github.com/repos/akanellop/env-spec-js","forks_url":"https://api.github.com/repos/akanellop/env-spec-js/forks","keys_url":"https://api.github.com/repos/akanellop/env-spec-js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/akanellop/env-spec-js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/akanellop/env-spec-js/teams","hooks_url":"https://api.github.com/repos/akanellop/env-spec-js/hooks","issue_events_url":"https://api.github.com/repos/akanellop/env-spec-js/issues/events{/number}","events_url":"https://api.github.com/repos/akanellop/env-spec-js/events","assignees_url":"https://api.github.com/repos/akanellop/env-spec-js/assignees{/user}","branches_url":"https://api.github.com/repos/akanellop/env-spec-js/branches{/branch}","tags_url":"https://api.github.com/repos/akanellop/env-spec-js/tags","blobs_url":"https://api.github.com/repos/akanellop/env-spec-js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/akanellop/env-spec-js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/akanellop/env-spec-js/git/refs{/sha}","trees_url":"https://api.github.com/repos/akanellop/env-spec-js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/akanellop/env-spec-js/statuses/{sha}","languages_url":"https://api.github.com/repos/akanellop/env-spec-js/languages","stargazers_url":"https://api.github.com/repos/akanellop/env-spec-js/stargazers","contributors_url":"https://api.github.com/repos/akanellop/env-spec-js/contributors","subscribers_url":"https://api.github.com/repos/akanellop/env-spec-js/subscribers","subscription_url":"https://api.github.com/repos/akanellop/env-spec-js/subscription","commits_url":"https://api.github.com/repos/akanellop/env-spec-js/commits{/sha}","git_commits_url":"https://api.github.com/repos/akanellop/env-spec-js/git/commits{/sha}","comments_url":"https://api.github.com/repos/akanellop/env-spec-js/comments{/number}","issue_comment_url":"https://api.github.com/repos/akanellop/env-spec-js/issues/comments{/number}","contents_url":"https://api.github.com/repos/akanellop/env-spec-js/contents/{+path}","compare_url":"https://api.github.com/repos/akanellop/env-spec-js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/akanellop/env-spec-js/merges","archive_url":"https://api.github.com/repos/akanellop/env-spec-js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/akanellop/env-spec-js/downloads","issues_url":"https://api.github.com/repos/akanellop/env-spec-js/issues{/number}","pulls_url":"https://api.github.com/repos/akanellop/env-spec-js/pulls{/number}","milestones_url":"https://api.github.com/repos/akanellop/env-spec-js/milestones{/number}","notifications_url":"https://api.github.com/repos/akanellop/env-spec-js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/akanellop/env-spec-js/labels{/name}","releases_url":"https://api.github.com/repos/akanellop/env-spec-js/releases{/id}","deployments_url":"https://api.github.com/repos/akanellop/env-spec-js/deployments","created_at":"2018-07-16T10:30:49Z","updated_at":"2018-07-20T10:39:09Z","pushed_at":"2018-07-20T11:46:12Z","git_url":"git://github.com/akanellop/env-spec-js.git","ssh_url":"git@github.com:akanellop/env-spec-js.git","clone_url":"https://github.com/akanellop/env-spec-js.git","svn_url":"https://github.com/akanellop/env-spec-js","homepage":null,"size":57,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"sourcelair:master","ref":"master","sha":"e2f93398a00eff1df29a70a6691edc316a9c9a6d","user":{"login":"sourcelair","id":799101,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc5OTEwMQ==","avatar_url":"https://avatars2.githubusercontent.com/u/799101?v=4","gravatar_id":"","url":"https://api.github.com/users/sourcelair","html_url":"https://github.com/sourcelair","followers_url":"https://api.github.com/users/sourcelair/followers","following_url":"https://api.github.com/users/sourcelair/following{/other_user}","gists_url":"https://api.github.com/users/sourcelair/gists{/gist_id}","starred_url":"https://api.github.com/users/sourcelair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sourcelair/subscriptions","organizations_url":"https://api.github.com/users/sourcelair/orgs","repos_url":"https://api.github.com/users/sourcelair/repos","events_url":"https://api.github.com/users/sourcelair/events{/privacy}","received_events_url":"https://api.github.com/users/sourcelair/received_events","type":"Organization","site_admin":false},"repo":{"id":141118963,"node_id":"MDEwOlJlcG9zaXRvcnkxNDExMTg5NjM=","name":"env-spec-js","full_name":"sourcelair/env-spec-js","owner":{"login":"sourcelair","id":799101,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc5OTEwMQ==","avatar_url":"https://avatars2.githubusercontent.com/u/799101?v=4","gravatar_id":"","url":"https://api.github.com/users/sourcelair","html_url":"https://github.com/sourcelair","followers_url":"https://api.github.com/users/sourcelair/followers","following_url":"https://api.github.com/users/sourcelair/following{/other_user}","gists_url":"https://api.github.com/users/sourcelair/gists{/gist_id}","starred_url":"https://api.github.com/users/sourcelair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sourcelair/subscriptions","organizations_url":"https://api.github.com/users/sourcelair/orgs","repos_url":"https://api.github.com/users/sourcelair/repos","events_url":"https://api.github.com/users/sourcelair/events{/privacy}","received_events_url":"https://api.github.com/users/sourcelair/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sourcelair/env-spec-js","description":null,"fork":false,"url":"https://api.github.com/repos/sourcelair/env-spec-js","forks_url":"https://api.github.com/repos/sourcelair/env-spec-js/forks","keys_url":"https://api.github.com/repos/sourcelair/env-spec-js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sourcelair/env-spec-js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sourcelair/env-spec-js/teams","hooks_url":"https://api.github.com/repos/sourcelair/env-spec-js/hooks","issue_events_url":"https://api.github.com/repos/sourcelair/env-spec-js/issues/events{/number}","events_url":"https://api.github.com/repos/sourcelair/env-spec-js/events","assignees_url":"https://api.github.com/repos/sourcelair/env-spec-js/assignees{/user}","branches_url":"https://api.github.com/repos/sourcelair/env-spec-js/branches{/branch}","tags_url":"https://api.github.com/repos/sourcelair/env-spec-js/tags","blobs_url":"https://api.github.com/repos/sourcelair/env-spec-js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sourcelair/env-spec-js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sourcelair/env-spec-js/git/refs{/sha}","trees_url":"https://api.github.com/repos/sourcelair/env-spec-js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sourcelair/env-spec-js/statuses/{sha}","languages_url":"https://api.github.com/repos/sourcelair/env-spec-js/languages","stargazers_url":"https://api.github.com/repos/sourcelair/env-spec-js/stargazers","contributors_url":"https://api.github.com/repos/sourcelair/env-spec-js/contributors","subscribers_url":"https://api.github.com/repos/sourcelair/env-spec-js/subscribers","subscription_url":"https://api.github.com/repos/sourcelair/env-spec-js/subscription","commits_url":"https://api.github.com/repos/sourcelair/env-spec-js/commits{/sha}","git_commits_url":"https://api.github.com/repos/sourcelair/env-spec-js/git/commits{/sha}","comments_url":"https://api.github.com/repos/sourcelair/env-spec-js/comments{/number}","issue_comment_url":"https://api.github.com/repos/sourcelair/env-spec-js/issues/comments{/number}","contents_url":"https://api.github.com/repos/sourcelair/env-spec-js/contents/{+path}","compare_url":"https://api.github.com/repos/sourcelair/env-spec-js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sourcelair/env-spec-js/merges","archive_url":"https://api.github.com/repos/sourcelair/env-spec-js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sourcelair/env-spec-js/downloads","issues_url":"https://api.github.com/repos/sourcelair/env-spec-js/issues{/number}","pulls_url":"https://api.github.com/repos/sourcelair/env-spec-js/pulls{/number}","milestones_url":"https://api.github.com/repos/sourcelair/env-spec-js/milestones{/number}","notifications_url":"https://api.github.com/repos/sourcelair/env-spec-js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sourcelair/env-spec-js/labels{/name}","releases_url":"https://api.github.com/repos/sourcelair/env-spec-js/releases{/id}","deployments_url":"https://api.github.com/repos/sourcelair/env-spec-js/deployments","created_at":"2018-07-16T09:44:54Z","updated_at":"2018-07-20T11:45:59Z","pushed_at":"2018-07-20T11:46:21Z","git_url":"git://github.com/sourcelair/env-spec-js.git","ssh_url":"git@github.com:sourcelair/env-spec-js.git","clone_url":"https://github.com/sourcelair/env-spec-js.git","svn_url":"https://github.com/sourcelair/env-spec-js","homepage":null,"size":55,"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":1,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sourcelair/env-spec-js/pulls/6"},"html":{"href":"https://github.com/sourcelair/env-spec-js/pull/6"},"issue":{"href":"https://api.github.com/repos/sourcelair/env-spec-js/issues/6"},"comments":{"href":"https://api.github.com/repos/sourcelair/env-spec-js/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/sourcelair/env-spec-js/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/sourcelair/env-spec-js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sourcelair/env-spec-js/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/sourcelair/env-spec-js/statuses/7e53681b820ebb21f63fdbce660db15f540903d5"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"parisk"}}