{"action":"created","comment":{"url":"https://api.github.com/repos/oss-specs/specs/pulls/comments/41967913","id":41967913,"diff_hunk":"@@ -35,9 +40,21 @@ function Config(configuration) {\n   this.regex = {};\n \n   // Define which file types the application willl process and display.\n-  this.regex['fileOfInterest'] = new RegExp('\\\\.(' + filesOfInterest.join('|') + ')$');\n+  this.regex['filesOfInterest'] = new RegExp('\\\\.(' + filesOfInterest.join('|') + ')$');\n+  this.regex['excludedPaths'] = new RegExp('^(' + this.excludedPaths.join('|') + ')');\n }\n \n+Config.prototype.isSupportedFile = function(path) {\n+  var validFile = path.match(this.regex[\"filesOfInterest\"]) != null;","path":"lib/configuration/index.js","position":22,"original_position":22,"commit_id":"468c18dd378fd5c8b6a1d69ce7dcba523531baec","original_commit_id":"468c18dd378fd5c8b6a1d69ce7dcba523531baec","user":{"login":"jimCresswell","id":1314980,"avatar_url":"https://avatars.githubusercontent.com/u/1314980?v=3","gravatar_id":"","url":"https://api.github.com/users/jimCresswell","html_url":"https://github.com/jimCresswell","followers_url":"https://api.github.com/users/jimCresswell/followers","following_url":"https://api.github.com/users/jimCresswell/following{/other_user}","gists_url":"https://api.github.com/users/jimCresswell/gists{/gist_id}","starred_url":"https://api.github.com/users/jimCresswell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimCresswell/subscriptions","organizations_url":"https://api.github.com/users/jimCresswell/orgs","repos_url":"https://api.github.com/users/jimCresswell/repos","events_url":"https://api.github.com/users/jimCresswell/events{/privacy}","received_events_url":"https://api.github.com/users/jimCresswell/received_events","type":"User","site_admin":false},"body":"as long as there are no hyphens, keywords or leading numbers in the key name you can access members of an object with the dot notation, and that will allow you to use the regex `test` function and still look neat e.g. `this.regex.filesOfInterest.test(path)` , which will return the boolean you want.\r\n\r\nGenerally where you do want to use a comparison use the strict equality form i.e. `===` or `!==`, the non-strict forms have complex rules on implicit type coercion that are a common source of bugs.","created_at":"2015-10-14T08:42:11Z","updated_at":"2015-10-14T08:42:11Z","html_url":"https://github.com/oss-specs/specs/pull/140#discussion_r41967913","pull_request_url":"https://api.github.com/repos/oss-specs/specs/pulls/140","_links":{"self":{"href":"https://api.github.com/repos/oss-specs/specs/pulls/comments/41967913"},"html":{"href":"https://github.com/oss-specs/specs/pull/140#discussion_r41967913"},"pull_request":{"href":"https://api.github.com/repos/oss-specs/specs/pulls/140"}}},"pull_request":{"url":"https://api.github.com/repos/oss-specs/specs/pulls/140","id":47522318,"html_url":"https://github.com/oss-specs/specs/pull/140","diff_url":"https://github.com/oss-specs/specs/pull/140.diff","patch_url":"https://github.com/oss-specs/specs/pull/140.patch","issue_url":"https://api.github.com/repos/oss-specs/specs/issues/140","number":140,"state":"open","locked":false,"title":"Feature/filtering","user":{"login":"sponte","id":47468,"avatar_url":"https://avatars.githubusercontent.com/u/47468?v=3","gravatar_id":"","url":"https://api.github.com/users/sponte","html_url":"https://github.com/sponte","followers_url":"https://api.github.com/users/sponte/followers","following_url":"https://api.github.com/users/sponte/following{/other_user}","gists_url":"https://api.github.com/users/sponte/gists{/gist_id}","starred_url":"https://api.github.com/users/sponte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sponte/subscriptions","organizations_url":"https://api.github.com/users/sponte/orgs","repos_url":"https://api.github.com/users/sponte/repos","events_url":"https://api.github.com/users/sponte/events{/privacy}","received_events_url":"https://api.github.com/users/sponte/received_events","type":"User","site_admin":false},"body":"@jimCresswell this one is waiting for #138 to be merged","created_at":"2015-10-13T11:44:14Z","updated_at":"2015-10-14T08:42:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a2f581b3bca53f7e872c2d0fba58103c839b7030","assignee":{"login":"jimCresswell","id":1314980,"avatar_url":"https://avatars.githubusercontent.com/u/1314980?v=3","gravatar_id":"","url":"https://api.github.com/users/jimCresswell","html_url":"https://github.com/jimCresswell","followers_url":"https://api.github.com/users/jimCresswell/followers","following_url":"https://api.github.com/users/jimCresswell/following{/other_user}","gists_url":"https://api.github.com/users/jimCresswell/gists{/gist_id}","starred_url":"https://api.github.com/users/jimCresswell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimCresswell/subscriptions","organizations_url":"https://api.github.com/users/jimCresswell/orgs","repos_url":"https://api.github.com/users/jimCresswell/repos","events_url":"https://api.github.com/users/jimCresswell/events{/privacy}","received_events_url":"https://api.github.com/users/jimCresswell/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/oss-specs/specs/pulls/140/commits","review_comments_url":"https://api.github.com/repos/oss-specs/specs/pulls/140/comments","review_comment_url":"https://api.github.com/repos/oss-specs/specs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/oss-specs/specs/issues/140/comments","statuses_url":"https://api.github.com/repos/oss-specs/specs/statuses/468c18dd378fd5c8b6a1d69ce7dcba523531baec","head":{"label":"oss-specs:feature/filtering","ref":"feature/filtering","sha":"468c18dd378fd5c8b6a1d69ce7dcba523531baec","user":{"login":"oss-specs","id":13120061,"avatar_url":"https://avatars.githubusercontent.com/u/13120061?v=3","gravatar_id":"","url":"https://api.github.com/users/oss-specs","html_url":"https://github.com/oss-specs","followers_url":"https://api.github.com/users/oss-specs/followers","following_url":"https://api.github.com/users/oss-specs/following{/other_user}","gists_url":"https://api.github.com/users/oss-specs/gists{/gist_id}","starred_url":"https://api.github.com/users/oss-specs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oss-specs/subscriptions","organizations_url":"https://api.github.com/users/oss-specs/orgs","repos_url":"https://api.github.com/users/oss-specs/repos","events_url":"https://api.github.com/users/oss-specs/events{/privacy}","received_events_url":"https://api.github.com/users/oss-specs/received_events","type":"Organization","site_admin":false},"repo":{"id":38098982,"name":"specs","full_name":"oss-specs/specs","owner":{"login":"oss-specs","id":13120061,"avatar_url":"https://avatars.githubusercontent.com/u/13120061?v=3","gravatar_id":"","url":"https://api.github.com/users/oss-specs","html_url":"https://github.com/oss-specs","followers_url":"https://api.github.com/users/oss-specs/followers","following_url":"https://api.github.com/users/oss-specs/following{/other_user}","gists_url":"https://api.github.com/users/oss-specs/gists{/gist_id}","starred_url":"https://api.github.com/users/oss-specs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oss-specs/subscriptions","organizations_url":"https://api.github.com/users/oss-specs/orgs","repos_url":"https://api.github.com/users/oss-specs/repos","events_url":"https://api.github.com/users/oss-specs/events{/privacy}","received_events_url":"https://api.github.com/users/oss-specs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/oss-specs/specs","description":"A service for exposing specification files in version control via a nice web UI","fork":false,"url":"https://api.github.com/repos/oss-specs/specs","forks_url":"https://api.github.com/repos/oss-specs/specs/forks","keys_url":"https://api.github.com/repos/oss-specs/specs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oss-specs/specs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oss-specs/specs/teams","hooks_url":"https://api.github.com/repos/oss-specs/specs/hooks","issue_events_url":"https://api.github.com/repos/oss-specs/specs/issues/events{/number}","events_url":"https://api.github.com/repos/oss-specs/specs/events","assignees_url":"https://api.github.com/repos/oss-specs/specs/assignees{/user}","branches_url":"https://api.github.com/repos/oss-specs/specs/branches{/branch}","tags_url":"https://api.github.com/repos/oss-specs/specs/tags","blobs_url":"https://api.github.com/repos/oss-specs/specs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oss-specs/specs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oss-specs/specs/git/refs{/sha}","trees_url":"https://api.github.com/repos/oss-specs/specs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oss-specs/specs/statuses/{sha}","languages_url":"https://api.github.com/repos/oss-specs/specs/languages","stargazers_url":"https://api.github.com/repos/oss-specs/specs/stargazers","contributors_url":"https://api.github.com/repos/oss-specs/specs/contributors","subscribers_url":"https://api.github.com/repos/oss-specs/specs/subscribers","subscription_url":"https://api.github.com/repos/oss-specs/specs/subscription","commits_url":"https://api.github.com/repos/oss-specs/specs/commits{/sha}","git_commits_url":"https://api.github.com/repos/oss-specs/specs/git/commits{/sha}","comments_url":"https://api.github.com/repos/oss-specs/specs/comments{/number}","issue_comment_url":"https://api.github.com/repos/oss-specs/specs/issues/comments{/number}","contents_url":"https://api.github.com/repos/oss-specs/specs/contents/{+path}","compare_url":"https://api.github.com/repos/oss-specs/specs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oss-specs/specs/merges","archive_url":"https://api.github.com/repos/oss-specs/specs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oss-specs/specs/downloads","issues_url":"https://api.github.com/repos/oss-specs/specs/issues{/number}","pulls_url":"https://api.github.com/repos/oss-specs/specs/pulls{/number}","milestones_url":"https://api.github.com/repos/oss-specs/specs/milestones{/number}","notifications_url":"https://api.github.com/repos/oss-specs/specs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oss-specs/specs/labels{/name}","releases_url":"https://api.github.com/repos/oss-specs/specs/releases{/id}","created_at":"2015-06-26T08:07:39Z","updated_at":"2015-07-01T09:18:37Z","pushed_at":"2015-10-13T16:24:48Z","git_url":"git://github.com/oss-specs/specs.git","ssh_url":"git@github.com:oss-specs/specs.git","clone_url":"https://github.com/oss-specs/specs.git","svn_url":"https://github.com/oss-specs/specs","homepage":null,"size":1474,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":15,"forks":1,"open_issues":15,"watchers":0,"default_branch":"master"}},"base":{"label":"oss-specs:master","ref":"master","sha":"f89f3e42a18328ddeb59f7b95c4ff4780bcf0432","user":{"login":"oss-specs","id":13120061,"avatar_url":"https://avatars.githubusercontent.com/u/13120061?v=3","gravatar_id":"","url":"https://api.github.com/users/oss-specs","html_url":"https://github.com/oss-specs","followers_url":"https://api.github.com/users/oss-specs/followers","following_url":"https://api.github.com/users/oss-specs/following{/other_user}","gists_url":"https://api.github.com/users/oss-specs/gists{/gist_id}","starred_url":"https://api.github.com/users/oss-specs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oss-specs/subscriptions","organizations_url":"https://api.github.com/users/oss-specs/orgs","repos_url":"https://api.github.com/users/oss-specs/repos","events_url":"https://api.github.com/users/oss-specs/events{/privacy}","received_events_url":"https://api.github.com/users/oss-specs/received_events","type":"Organization","site_admin":false},"repo":{"id":38098982,"name":"specs","full_name":"oss-specs/specs","owner":{"login":"oss-specs","id":13120061,"avatar_url":"https://avatars.githubusercontent.com/u/13120061?v=3","gravatar_id":"","url":"https://api.github.com/users/oss-specs","html_url":"https://github.com/oss-specs","followers_url":"https://api.github.com/users/oss-specs/followers","following_url":"https://api.github.com/users/oss-specs/following{/other_user}","gists_url":"https://api.github.com/users/oss-specs/gists{/gist_id}","starred_url":"https://api.github.com/users/oss-specs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oss-specs/subscriptions","organizations_url":"https://api.github.com/users/oss-specs/orgs","repos_url":"https://api.github.com/users/oss-specs/repos","events_url":"https://api.github.com/users/oss-specs/events{/privacy}","received_events_url":"https://api.github.com/users/oss-specs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/oss-specs/specs","description":"A service for exposing specification files in version control via a nice web UI","fork":false,"url":"https://api.github.com/repos/oss-specs/specs","forks_url":"https://api.github.com/repos/oss-specs/specs/forks","keys_url":"https://api.github.com/repos/oss-specs/specs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oss-specs/specs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oss-specs/specs/teams","hooks_url":"https://api.github.com/repos/oss-specs/specs/hooks","issue_events_url":"https://api.github.com/repos/oss-specs/specs/issues/events{/number}","events_url":"https://api.github.com/repos/oss-specs/specs/events","assignees_url":"https://api.github.com/repos/oss-specs/specs/assignees{/user}","branches_url":"https://api.github.com/repos/oss-specs/specs/branches{/branch}","tags_url":"https://api.github.com/repos/oss-specs/specs/tags","blobs_url":"https://api.github.com/repos/oss-specs/specs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oss-specs/specs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oss-specs/specs/git/refs{/sha}","trees_url":"https://api.github.com/repos/oss-specs/specs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oss-specs/specs/statuses/{sha}","languages_url":"https://api.github.com/repos/oss-specs/specs/languages","stargazers_url":"https://api.github.com/repos/oss-specs/specs/stargazers","contributors_url":"https://api.github.com/repos/oss-specs/specs/contributors","subscribers_url":"https://api.github.com/repos/oss-specs/specs/subscribers","subscription_url":"https://api.github.com/repos/oss-specs/specs/subscription","commits_url":"https://api.github.com/repos/oss-specs/specs/commits{/sha}","git_commits_url":"https://api.github.com/repos/oss-specs/specs/git/commits{/sha}","comments_url":"https://api.github.com/repos/oss-specs/specs/comments{/number}","issue_comment_url":"https://api.github.com/repos/oss-specs/specs/issues/comments{/number}","contents_url":"https://api.github.com/repos/oss-specs/specs/contents/{+path}","compare_url":"https://api.github.com/repos/oss-specs/specs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oss-specs/specs/merges","archive_url":"https://api.github.com/repos/oss-specs/specs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oss-specs/specs/downloads","issues_url":"https://api.github.com/repos/oss-specs/specs/issues{/number}","pulls_url":"https://api.github.com/repos/oss-specs/specs/pulls{/number}","milestones_url":"https://api.github.com/repos/oss-specs/specs/milestones{/number}","notifications_url":"https://api.github.com/repos/oss-specs/specs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oss-specs/specs/labels{/name}","releases_url":"https://api.github.com/repos/oss-specs/specs/releases{/id}","created_at":"2015-06-26T08:07:39Z","updated_at":"2015-07-01T09:18:37Z","pushed_at":"2015-10-13T16:24:48Z","git_url":"git://github.com/oss-specs/specs.git","ssh_url":"git@github.com:oss-specs/specs.git","clone_url":"https://github.com/oss-specs/specs.git","svn_url":"https://github.com/oss-specs/specs","homepage":null,"size":1474,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":15,"forks":1,"open_issues":15,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/oss-specs/specs/pulls/140"},"html":{"href":"https://github.com/oss-specs/specs/pull/140"},"issue":{"href":"https://api.github.com/repos/oss-specs/specs/issues/140"},"comments":{"href":"https://api.github.com/repos/oss-specs/specs/issues/140/comments"},"review_comments":{"href":"https://api.github.com/repos/oss-specs/specs/pulls/140/comments"},"review_comment":{"href":"https://api.github.com/repos/oss-specs/specs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/oss-specs/specs/pulls/140/commits"},"statuses":{"href":"https://api.github.com/repos/oss-specs/specs/statuses/468c18dd378fd5c8b6a1d69ce7dcba523531baec"}}}}