{"action":"created","comment":{"url":"https://api.github.com/repos/hapijs/mimos/pulls/comments/64407598","id":64407598,"diff_hunk":"@@ -58,41 +44,49 @@ internals.compile = function (override) {\n };\n \n \n-internals.base = internals.compile();       // Prevents an expensive copy on each constructor when no customization is needed\n-\n-\n-internals.Mimos.prototype.path = function (path) {\n+class Mimos {\n+    constructor(options) {\n \n-    const extension = Path.extname(path).slice(1).toLowerCase();\n-    const mime = this._byExtension[extension] || {};\n-\n-    if (mime.predicate) {\n-        return mime.predicate(Hoek.clone(mime));\n+        options = options || {};\n+        const result = options.override ? internals.compile(options.override) : internals.base;\n+        this._byType = result.byType;\n+        this._byExtension = result.byExtension;\n     }\n+    path(path) {\n \n-    return mime;\n-};\n+        const extension = Path.extname(path).slice(1).toLowerCase();\n+        const mime = this._byExtension[extension] || {};\n \n+        if (mime.predicate) {\n+            return mime.predicate(Hoek.clone(mime));\n+        }\n \n-internals.Mimos.prototype.type = function (type) {\n+        return mime;\n+    }\n+    type(type) {\n+\n+        type = type.split(';', 1)[0].trim().toLowerCase();\n+        let mime = this._byType[type];\n+        if (!mime) {\n+            mime = {\n+                type: type,\n+                source: 'mimos',\n+                extensions: [],\n+                compressible: internals.compressibleRx.test(type)\n+            };\n+\n+            this._byType[type] = mime;\n+            return mime;\n+        }\n \n-    type = type.split(';', 1)[0].trim().toLowerCase();\n-    let mime = this._byType[type];\n-    if (!mime) {\n-        mime = {\n-            type: type,\n-            source: 'mimos',\n-            extensions: [],\n-            compressible: internals.compressibleRx.test(type)\n-        };\n+        if (mime.predicate) {\n+            return mime.predicate(Hoek.clone(mime));\n+        }\n \n-        this._byType[type] = mime;\n         return mime;\n     }\n+}\n \n-    if (mime.predicate) {\n-        return mime.predicate(Hoek.clone(mime));\n-    }\n+internals.base = internals.compile();       // Prevents an expensive copy on each constructor when no customization is needed\n \n-    return mime;\n-};\n+module.exports = Mimos;","path":"lib/index.js","position":97,"original_position":97,"commit_id":"00511da930dae0d1c5f88afb807541f0b0487d5e","original_commit_id":"00511da930dae0d1c5f88afb807541f0b0487d5e","user":{"login":"geek","id":441346,"avatar_url":"https://avatars.githubusercontent.com/u/441346?v=3","gravatar_id":"","url":"https://api.github.com/users/geek","html_url":"https://github.com/geek","followers_url":"https://api.github.com/users/geek/followers","following_url":"https://api.github.com/users/geek/following{/other_user}","gists_url":"https://api.github.com/users/geek/gists{/gist_id}","starred_url":"https://api.github.com/users/geek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geek/subscriptions","organizations_url":"https://api.github.com/users/geek/orgs","repos_url":"https://api.github.com/users/geek/repos","events_url":"https://api.github.com/users/geek/events{/privacy}","received_events_url":"https://api.github.com/users/geek/received_events","type":"User","site_admin":false},"body":"Move to the top where class is created","created_at":"2016-05-24T14:57:34Z","updated_at":"2016-05-24T14:57:34Z","html_url":"https://github.com/hapijs/mimos/pull/18#discussion_r64407598","pull_request_url":"https://api.github.com/repos/hapijs/mimos/pulls/18","_links":{"self":{"href":"https://api.github.com/repos/hapijs/mimos/pulls/comments/64407598"},"html":{"href":"https://github.com/hapijs/mimos/pull/18#discussion_r64407598"},"pull_request":{"href":"https://api.github.com/repos/hapijs/mimos/pulls/18"}}},"pull_request":{"url":"https://api.github.com/repos/hapijs/mimos/pulls/18","id":70987113,"html_url":"https://github.com/hapijs/mimos/pull/18","diff_url":"https://github.com/hapijs/mimos/pull/18.diff","patch_url":"https://github.com/hapijs/mimos/pull/18.patch","issue_url":"https://api.github.com/repos/hapijs/mimos/issues/18","number":18,"state":"open","locked":false,"title":"Code3","user":{"login":"arb","id":1591483,"avatar_url":"https://avatars.githubusercontent.com/u/1591483?v=3","gravatar_id":"","url":"https://api.github.com/users/arb","html_url":"https://github.com/arb","followers_url":"https://api.github.com/users/arb/followers","following_url":"https://api.github.com/users/arb/following{/other_user}","gists_url":"https://api.github.com/users/arb/gists{/gist_id}","starred_url":"https://api.github.com/users/arb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arb/subscriptions","organizations_url":"https://api.github.com/users/arb/orgs","repos_url":"https://api.github.com/users/arb/repos","events_url":"https://api.github.com/users/arb/events{/privacy}","received_events_url":"https://api.github.com/users/arb/received_events","type":"User","site_admin":false},"body":"Updated code version\r\nUpdated to use ES6 class\r\nCleaned up documentation to discourage `var` use","created_at":"2016-05-22T20:17:19Z","updated_at":"2016-05-24T14:57:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b6973ae7424be175bd38c72054b7faf66310ad6a","assignee":null,"milestone":{"url":"https://api.github.com/repos/hapijs/mimos/milestones/7","html_url":"https://github.com/hapijs/mimos/milestones/3.0.2","labels_url":"https://api.github.com/repos/hapijs/mimos/milestones/7/labels","id":1756214,"number":7,"title":"3.0.2","description":"","creator":{"login":"arb","id":1591483,"avatar_url":"https://avatars.githubusercontent.com/u/1591483?v=3","gravatar_id":"","url":"https://api.github.com/users/arb","html_url":"https://github.com/arb","followers_url":"https://api.github.com/users/arb/followers","following_url":"https://api.github.com/users/arb/following{/other_user}","gists_url":"https://api.github.com/users/arb/gists{/gist_id}","starred_url":"https://api.github.com/users/arb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arb/subscriptions","organizations_url":"https://api.github.com/users/arb/orgs","repos_url":"https://api.github.com/users/arb/repos","events_url":"https://api.github.com/users/arb/events{/privacy}","received_events_url":"https://api.github.com/users/arb/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":0,"state":"open","created_at":"2016-05-09T18:30:12Z","updated_at":"2016-05-24T14:55:45Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/hapijs/mimos/pulls/18/commits","review_comments_url":"https://api.github.com/repos/hapijs/mimos/pulls/18/comments","review_comment_url":"https://api.github.com/repos/hapijs/mimos/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hapijs/mimos/issues/18/comments","statuses_url":"https://api.github.com/repos/hapijs/mimos/statuses/00511da930dae0d1c5f88afb807541f0b0487d5e","head":{"label":"arb:code3","ref":"code3","sha":"00511da930dae0d1c5f88afb807541f0b0487d5e","user":{"login":"arb","id":1591483,"avatar_url":"https://avatars.githubusercontent.com/u/1591483?v=3","gravatar_id":"","url":"https://api.github.com/users/arb","html_url":"https://github.com/arb","followers_url":"https://api.github.com/users/arb/followers","following_url":"https://api.github.com/users/arb/following{/other_user}","gists_url":"https://api.github.com/users/arb/gists{/gist_id}","starred_url":"https://api.github.com/users/arb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arb/subscriptions","organizations_url":"https://api.github.com/users/arb/orgs","repos_url":"https://api.github.com/users/arb/repos","events_url":"https://api.github.com/users/arb/events{/privacy}","received_events_url":"https://api.github.com/users/arb/received_events","type":"User","site_admin":false},"repo":{"id":24347040,"name":"mimos","full_name":"arb/mimos","owner":{"login":"arb","id":1591483,"avatar_url":"https://avatars.githubusercontent.com/u/1591483?v=3","gravatar_id":"","url":"https://api.github.com/users/arb","html_url":"https://github.com/arb","followers_url":"https://api.github.com/users/arb/followers","following_url":"https://api.github.com/users/arb/following{/other_user}","gists_url":"https://api.github.com/users/arb/gists{/gist_id}","starred_url":"https://api.github.com/users/arb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arb/subscriptions","organizations_url":"https://api.github.com/users/arb/orgs","repos_url":"https://api.github.com/users/arb/repos","events_url":"https://api.github.com/users/arb/events{/privacy}","received_events_url":"https://api.github.com/users/arb/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/arb/mimos","description":"Mime database interface","fork":true,"url":"https://api.github.com/repos/arb/mimos","forks_url":"https://api.github.com/repos/arb/mimos/forks","keys_url":"https://api.github.com/repos/arb/mimos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/arb/mimos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/arb/mimos/teams","hooks_url":"https://api.github.com/repos/arb/mimos/hooks","issue_events_url":"https://api.github.com/repos/arb/mimos/issues/events{/number}","events_url":"https://api.github.com/repos/arb/mimos/events","assignees_url":"https://api.github.com/repos/arb/mimos/assignees{/user}","branches_url":"https://api.github.com/repos/arb/mimos/branches{/branch}","tags_url":"https://api.github.com/repos/arb/mimos/tags","blobs_url":"https://api.github.com/repos/arb/mimos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/arb/mimos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/arb/mimos/git/refs{/sha}","trees_url":"https://api.github.com/repos/arb/mimos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/arb/mimos/statuses/{sha}","languages_url":"https://api.github.com/repos/arb/mimos/languages","stargazers_url":"https://api.github.com/repos/arb/mimos/stargazers","contributors_url":"https://api.github.com/repos/arb/mimos/contributors","subscribers_url":"https://api.github.com/repos/arb/mimos/subscribers","subscription_url":"https://api.github.com/repos/arb/mimos/subscription","commits_url":"https://api.github.com/repos/arb/mimos/commits{/sha}","git_commits_url":"https://api.github.com/repos/arb/mimos/git/commits{/sha}","comments_url":"https://api.github.com/repos/arb/mimos/comments{/number}","issue_comment_url":"https://api.github.com/repos/arb/mimos/issues/comments{/number}","contents_url":"https://api.github.com/repos/arb/mimos/contents/{+path}","compare_url":"https://api.github.com/repos/arb/mimos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/arb/mimos/merges","archive_url":"https://api.github.com/repos/arb/mimos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/arb/mimos/downloads","issues_url":"https://api.github.com/repos/arb/mimos/issues{/number}","pulls_url":"https://api.github.com/repos/arb/mimos/pulls{/number}","milestones_url":"https://api.github.com/repos/arb/mimos/milestones{/number}","notifications_url":"https://api.github.com/repos/arb/mimos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/arb/mimos/labels{/name}","releases_url":"https://api.github.com/repos/arb/mimos/releases{/id}","deployments_url":"https://api.github.com/repos/arb/mimos/deployments","created_at":"2014-09-22T21:54:59Z","updated_at":"2014-09-21T06:18:42Z","pushed_at":"2016-05-22T22:49:24Z","git_url":"git://github.com/arb/mimos.git","ssh_url":"git@github.com:arb/mimos.git","clone_url":"https://github.com/arb/mimos.git","svn_url":"https://github.com/arb/mimos","homepage":null,"size":28,"stargazers_count":0,"watchers_count":0,"language":null,"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":"hapijs:master","ref":"master","sha":"31e106cf71630b83f86e5e678d2ef248fd7aee6b","user":{"login":"hapijs","id":3774533,"avatar_url":"https://avatars.githubusercontent.com/u/3774533?v=3","gravatar_id":"","url":"https://api.github.com/users/hapijs","html_url":"https://github.com/hapijs","followers_url":"https://api.github.com/users/hapijs/followers","following_url":"https://api.github.com/users/hapijs/following{/other_user}","gists_url":"https://api.github.com/users/hapijs/gists{/gist_id}","starred_url":"https://api.github.com/users/hapijs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hapijs/subscriptions","organizations_url":"https://api.github.com/users/hapijs/orgs","repos_url":"https://api.github.com/users/hapijs/repos","events_url":"https://api.github.com/users/hapijs/events{/privacy}","received_events_url":"https://api.github.com/users/hapijs/received_events","type":"Organization","site_admin":false},"repo":{"id":24283695,"name":"mimos","full_name":"hapijs/mimos","owner":{"login":"hapijs","id":3774533,"avatar_url":"https://avatars.githubusercontent.com/u/3774533?v=3","gravatar_id":"","url":"https://api.github.com/users/hapijs","html_url":"https://github.com/hapijs","followers_url":"https://api.github.com/users/hapijs/followers","following_url":"https://api.github.com/users/hapijs/following{/other_user}","gists_url":"https://api.github.com/users/hapijs/gists{/gist_id}","starred_url":"https://api.github.com/users/hapijs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hapijs/subscriptions","organizations_url":"https://api.github.com/users/hapijs/orgs","repos_url":"https://api.github.com/users/hapijs/repos","events_url":"https://api.github.com/users/hapijs/events{/privacy}","received_events_url":"https://api.github.com/users/hapijs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hapijs/mimos","description":"Mime database interface","fork":false,"url":"https://api.github.com/repos/hapijs/mimos","forks_url":"https://api.github.com/repos/hapijs/mimos/forks","keys_url":"https://api.github.com/repos/hapijs/mimos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hapijs/mimos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hapijs/mimos/teams","hooks_url":"https://api.github.com/repos/hapijs/mimos/hooks","issue_events_url":"https://api.github.com/repos/hapijs/mimos/issues/events{/number}","events_url":"https://api.github.com/repos/hapijs/mimos/events","assignees_url":"https://api.github.com/repos/hapijs/mimos/assignees{/user}","branches_url":"https://api.github.com/repos/hapijs/mimos/branches{/branch}","tags_url":"https://api.github.com/repos/hapijs/mimos/tags","blobs_url":"https://api.github.com/repos/hapijs/mimos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hapijs/mimos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hapijs/mimos/git/refs{/sha}","trees_url":"https://api.github.com/repos/hapijs/mimos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hapijs/mimos/statuses/{sha}","languages_url":"https://api.github.com/repos/hapijs/mimos/languages","stargazers_url":"https://api.github.com/repos/hapijs/mimos/stargazers","contributors_url":"https://api.github.com/repos/hapijs/mimos/contributors","subscribers_url":"https://api.github.com/repos/hapijs/mimos/subscribers","subscription_url":"https://api.github.com/repos/hapijs/mimos/subscription","commits_url":"https://api.github.com/repos/hapijs/mimos/commits{/sha}","git_commits_url":"https://api.github.com/repos/hapijs/mimos/git/commits{/sha}","comments_url":"https://api.github.com/repos/hapijs/mimos/comments{/number}","issue_comment_url":"https://api.github.com/repos/hapijs/mimos/issues/comments{/number}","contents_url":"https://api.github.com/repos/hapijs/mimos/contents/{+path}","compare_url":"https://api.github.com/repos/hapijs/mimos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hapijs/mimos/merges","archive_url":"https://api.github.com/repos/hapijs/mimos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hapijs/mimos/downloads","issues_url":"https://api.github.com/repos/hapijs/mimos/issues{/number}","pulls_url":"https://api.github.com/repos/hapijs/mimos/pulls{/number}","milestones_url":"https://api.github.com/repos/hapijs/mimos/milestones{/number}","notifications_url":"https://api.github.com/repos/hapijs/mimos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hapijs/mimos/labels{/name}","releases_url":"https://api.github.com/repos/hapijs/mimos/releases{/id}","deployments_url":"https://api.github.com/repos/hapijs/mimos/deployments","created_at":"2014-09-21T06:10:00Z","updated_at":"2016-05-11T11:25:50Z","pushed_at":"2016-05-22T22:49:24Z","git_url":"git://github.com/hapijs/mimos.git","ssh_url":"git@github.com:hapijs/mimos.git","clone_url":"https://github.com/hapijs/mimos.git","svn_url":"https://github.com/hapijs/mimos","homepage":null,"size":25,"stargazers_count":6,"watchers_count":6,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":1,"forks":5,"open_issues":1,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hapijs/mimos/pulls/18"},"html":{"href":"https://github.com/hapijs/mimos/pull/18"},"issue":{"href":"https://api.github.com/repos/hapijs/mimos/issues/18"},"comments":{"href":"https://api.github.com/repos/hapijs/mimos/issues/18/comments"},"review_comments":{"href":"https://api.github.com/repos/hapijs/mimos/pulls/18/comments"},"review_comment":{"href":"https://api.github.com/repos/hapijs/mimos/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hapijs/mimos/pulls/18/commits"},"statuses":{"href":"https://api.github.com/repos/hapijs/mimos/statuses/00511da930dae0d1c5f88afb807541f0b0487d5e"}}}}
{"actor":{"display_login":"geek"}}