{"action":"created","comment":{"url":"https://api.github.com/repos/zertosh/jstify/pulls/comments/44221556","id":44221556,"diff_hunk":"@@ -93,10 +85,32 @@ Jstify.prototype._flush = function (next) {\n   next();\n };\n \n+function parseExtensions (extensions) {\n+  if (typeof extensions === 'string') {\n+    return extensions.replace(' ', '').split(',');","path":"index.js","position":39,"original_position":39,"commit_id":"683fecc4bc8871cc441fbeef7098a35e8d9553d0","original_commit_id":"683fecc4bc8871cc441fbeef7098a35e8d9553d0","user":{"login":"zertosh","id":830952,"avatar_url":"https://avatars.githubusercontent.com/u/830952?v=3","gravatar_id":"","url":"https://api.github.com/users/zertosh","html_url":"https://github.com/zertosh","followers_url":"https://api.github.com/users/zertosh/followers","following_url":"https://api.github.com/users/zertosh/following{/other_user}","gists_url":"https://api.github.com/users/zertosh/gists{/gist_id}","starred_url":"https://api.github.com/users/zertosh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zertosh/subscriptions","organizations_url":"https://api.github.com/users/zertosh/orgs","repos_url":"https://api.github.com/users/zertosh/repos","events_url":"https://api.github.com/users/zertosh/events{/privacy}","received_events_url":"https://api.github.com/users/zertosh/received_events","type":"User","site_admin":false},"body":"Nah, no string parsing. Take the values as they come. But you need to do the `opts.extensions._` bit because that's how [subarg](https://github.com/substack/subarg) handles \"contexts\":\r\n\r\n```js\r\n// -t [ jstify --extensions .html  ]\r\nopts = {\r\n  extensions: '.html',\r\n}\r\n\r\n// -t [ jstify --extensions .html --extensions .svg ]\r\nopts = {\r\n  extensions: [ '.html', '.svg' ]\r\n}\r\n\r\n// -t [ jstify --extensions [ .html ] ]\r\nopts = {\r\n  extensions: {\r\n    _: [ '.html'  ]\r\n  }\r\n}\r\n\r\n// -t [ jstify --extensions [ .html .svg ] ]\r\nopts = {\r\n  extensions: {\r\n    _: [ '.html', '.svg' ]\r\n  }\r\n}\r\n\r\n// DON'T WORRY ABOUT THIS CASE:\r\n// -t [ jstify --extensions [ .html .svg ] --extensions .tpl ]\r\nopts = {\r\n  extensions: [\r\n    { _: [ '.html', '.svg' ] },\r\n    '.tpl'\r\n  ]\r\n}\r\n```\r\n\r\nThe easier thing to do is:\r\n\r\n```\r\nvar extensions = [].concat(opts.extensions, opts.extensions._).filter(Boolean);\r\n```\r\n\r\nThat'll handle all the cases but the last - don't worry about that one.","created_at":"2015-11-08T07:16:20Z","updated_at":"2015-11-08T07:16:20Z","html_url":"https://github.com/zertosh/jstify/pull/22#discussion_r44221556","pull_request_url":"https://api.github.com/repos/zertosh/jstify/pulls/22","_links":{"self":{"href":"https://api.github.com/repos/zertosh/jstify/pulls/comments/44221556"},"html":{"href":"https://github.com/zertosh/jstify/pull/22#discussion_r44221556"},"pull_request":{"href":"https://api.github.com/repos/zertosh/jstify/pulls/22"}}},"pull_request":{"url":"https://api.github.com/repos/zertosh/jstify/pulls/22","id":50050640,"html_url":"https://github.com/zertosh/jstify/pull/22","diff_url":"https://github.com/zertosh/jstify/pull/22.diff","patch_url":"https://github.com/zertosh/jstify/pull/22.patch","issue_url":"https://api.github.com/repos/zertosh/jstify/issues/22","number":22,"state":"open","locked":false,"title":"Add custom extensions","user":{"login":"blopker","id":757503,"avatar_url":"https://avatars.githubusercontent.com/u/757503?v=3","gravatar_id":"","url":"https://api.github.com/users/blopker","html_url":"https://github.com/blopker","followers_url":"https://api.github.com/users/blopker/followers","following_url":"https://api.github.com/users/blopker/following{/other_user}","gists_url":"https://api.github.com/users/blopker/gists{/gist_id}","starred_url":"https://api.github.com/users/blopker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blopker/subscriptions","organizations_url":"https://api.github.com/users/blopker/orgs","repos_url":"https://api.github.com/users/blopker/repos","events_url":"https://api.github.com/users/blopker/events{/privacy}","received_events_url":"https://api.github.com/users/blopker/received_events","type":"User","site_admin":false},"body":"A crack at implementing #18.\r\n\r\nTried to reduce overhead for the default case by pre-compiling the regexp.","created_at":"2015-11-08T01:56:06Z","updated_at":"2015-11-08T07:16:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"df7c6ed5a697f5fb56ebb90b28790c8b5ff33f27","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/zertosh/jstify/pulls/22/commits","review_comments_url":"https://api.github.com/repos/zertosh/jstify/pulls/22/comments","review_comment_url":"https://api.github.com/repos/zertosh/jstify/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zertosh/jstify/issues/22/comments","statuses_url":"https://api.github.com/repos/zertosh/jstify/statuses/683fecc4bc8871cc441fbeef7098a35e8d9553d0","head":{"label":"zertosh:feature/custom-extensions","ref":"feature/custom-extensions","sha":"683fecc4bc8871cc441fbeef7098a35e8d9553d0","user":{"login":"zertosh","id":830952,"avatar_url":"https://avatars.githubusercontent.com/u/830952?v=3","gravatar_id":"","url":"https://api.github.com/users/zertosh","html_url":"https://github.com/zertosh","followers_url":"https://api.github.com/users/zertosh/followers","following_url":"https://api.github.com/users/zertosh/following{/other_user}","gists_url":"https://api.github.com/users/zertosh/gists{/gist_id}","starred_url":"https://api.github.com/users/zertosh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zertosh/subscriptions","organizations_url":"https://api.github.com/users/zertosh/orgs","repos_url":"https://api.github.com/users/zertosh/repos","events_url":"https://api.github.com/users/zertosh/events{/privacy}","received_events_url":"https://api.github.com/users/zertosh/received_events","type":"User","site_admin":false},"repo":{"id":16938761,"name":"jstify","full_name":"zertosh/jstify","owner":{"login":"zertosh","id":830952,"avatar_url":"https://avatars.githubusercontent.com/u/830952?v=3","gravatar_id":"","url":"https://api.github.com/users/zertosh","html_url":"https://github.com/zertosh","followers_url":"https://api.github.com/users/zertosh/followers","following_url":"https://api.github.com/users/zertosh/following{/other_user}","gists_url":"https://api.github.com/users/zertosh/gists{/gist_id}","starred_url":"https://api.github.com/users/zertosh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zertosh/subscriptions","organizations_url":"https://api.github.com/users/zertosh/orgs","repos_url":"https://api.github.com/users/zertosh/repos","events_url":"https://api.github.com/users/zertosh/events{/privacy}","received_events_url":"https://api.github.com/users/zertosh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zertosh/jstify","description":"Browserify transform for pre-compiled Underscore and Lo-Dash templates (with HTML minification)","fork":false,"url":"https://api.github.com/repos/zertosh/jstify","forks_url":"https://api.github.com/repos/zertosh/jstify/forks","keys_url":"https://api.github.com/repos/zertosh/jstify/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zertosh/jstify/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zertosh/jstify/teams","hooks_url":"https://api.github.com/repos/zertosh/jstify/hooks","issue_events_url":"https://api.github.com/repos/zertosh/jstify/issues/events{/number}","events_url":"https://api.github.com/repos/zertosh/jstify/events","assignees_url":"https://api.github.com/repos/zertosh/jstify/assignees{/user}","branches_url":"https://api.github.com/repos/zertosh/jstify/branches{/branch}","tags_url":"https://api.github.com/repos/zertosh/jstify/tags","blobs_url":"https://api.github.com/repos/zertosh/jstify/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zertosh/jstify/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zertosh/jstify/git/refs{/sha}","trees_url":"https://api.github.com/repos/zertosh/jstify/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zertosh/jstify/statuses/{sha}","languages_url":"https://api.github.com/repos/zertosh/jstify/languages","stargazers_url":"https://api.github.com/repos/zertosh/jstify/stargazers","contributors_url":"https://api.github.com/repos/zertosh/jstify/contributors","subscribers_url":"https://api.github.com/repos/zertosh/jstify/subscribers","subscription_url":"https://api.github.com/repos/zertosh/jstify/subscription","commits_url":"https://api.github.com/repos/zertosh/jstify/commits{/sha}","git_commits_url":"https://api.github.com/repos/zertosh/jstify/git/commits{/sha}","comments_url":"https://api.github.com/repos/zertosh/jstify/comments{/number}","issue_comment_url":"https://api.github.com/repos/zertosh/jstify/issues/comments{/number}","contents_url":"https://api.github.com/repos/zertosh/jstify/contents/{+path}","compare_url":"https://api.github.com/repos/zertosh/jstify/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zertosh/jstify/merges","archive_url":"https://api.github.com/repos/zertosh/jstify/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zertosh/jstify/downloads","issues_url":"https://api.github.com/repos/zertosh/jstify/issues{/number}","pulls_url":"https://api.github.com/repos/zertosh/jstify/pulls{/number}","milestones_url":"https://api.github.com/repos/zertosh/jstify/milestones{/number}","notifications_url":"https://api.github.com/repos/zertosh/jstify/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zertosh/jstify/labels{/name}","releases_url":"https://api.github.com/repos/zertosh/jstify/releases{/id}","created_at":"2014-02-18T06:01:25Z","updated_at":"2015-11-05T21:04:52Z","pushed_at":"2015-11-08T06:49:55Z","git_url":"git://github.com/zertosh/jstify.git","ssh_url":"git@github.com:zertosh/jstify.git","clone_url":"https://github.com/zertosh/jstify.git","svn_url":"https://github.com/zertosh/jstify","homepage":"","size":374,"stargazers_count":37,"watchers_count":37,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":3,"forks":11,"open_issues":3,"watchers":37,"default_branch":"master"}},"base":{"label":"zertosh:master","ref":"master","sha":"eefd274b16bf6e7d7502eada2474973af835cc24","user":{"login":"zertosh","id":830952,"avatar_url":"https://avatars.githubusercontent.com/u/830952?v=3","gravatar_id":"","url":"https://api.github.com/users/zertosh","html_url":"https://github.com/zertosh","followers_url":"https://api.github.com/users/zertosh/followers","following_url":"https://api.github.com/users/zertosh/following{/other_user}","gists_url":"https://api.github.com/users/zertosh/gists{/gist_id}","starred_url":"https://api.github.com/users/zertosh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zertosh/subscriptions","organizations_url":"https://api.github.com/users/zertosh/orgs","repos_url":"https://api.github.com/users/zertosh/repos","events_url":"https://api.github.com/users/zertosh/events{/privacy}","received_events_url":"https://api.github.com/users/zertosh/received_events","type":"User","site_admin":false},"repo":{"id":16938761,"name":"jstify","full_name":"zertosh/jstify","owner":{"login":"zertosh","id":830952,"avatar_url":"https://avatars.githubusercontent.com/u/830952?v=3","gravatar_id":"","url":"https://api.github.com/users/zertosh","html_url":"https://github.com/zertosh","followers_url":"https://api.github.com/users/zertosh/followers","following_url":"https://api.github.com/users/zertosh/following{/other_user}","gists_url":"https://api.github.com/users/zertosh/gists{/gist_id}","starred_url":"https://api.github.com/users/zertosh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zertosh/subscriptions","organizations_url":"https://api.github.com/users/zertosh/orgs","repos_url":"https://api.github.com/users/zertosh/repos","events_url":"https://api.github.com/users/zertosh/events{/privacy}","received_events_url":"https://api.github.com/users/zertosh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zertosh/jstify","description":"Browserify transform for pre-compiled Underscore and Lo-Dash templates (with HTML minification)","fork":false,"url":"https://api.github.com/repos/zertosh/jstify","forks_url":"https://api.github.com/repos/zertosh/jstify/forks","keys_url":"https://api.github.com/repos/zertosh/jstify/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zertosh/jstify/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zertosh/jstify/teams","hooks_url":"https://api.github.com/repos/zertosh/jstify/hooks","issue_events_url":"https://api.github.com/repos/zertosh/jstify/issues/events{/number}","events_url":"https://api.github.com/repos/zertosh/jstify/events","assignees_url":"https://api.github.com/repos/zertosh/jstify/assignees{/user}","branches_url":"https://api.github.com/repos/zertosh/jstify/branches{/branch}","tags_url":"https://api.github.com/repos/zertosh/jstify/tags","blobs_url":"https://api.github.com/repos/zertosh/jstify/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zertosh/jstify/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zertosh/jstify/git/refs{/sha}","trees_url":"https://api.github.com/repos/zertosh/jstify/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zertosh/jstify/statuses/{sha}","languages_url":"https://api.github.com/repos/zertosh/jstify/languages","stargazers_url":"https://api.github.com/repos/zertosh/jstify/stargazers","contributors_url":"https://api.github.com/repos/zertosh/jstify/contributors","subscribers_url":"https://api.github.com/repos/zertosh/jstify/subscribers","subscription_url":"https://api.github.com/repos/zertosh/jstify/subscription","commits_url":"https://api.github.com/repos/zertosh/jstify/commits{/sha}","git_commits_url":"https://api.github.com/repos/zertosh/jstify/git/commits{/sha}","comments_url":"https://api.github.com/repos/zertosh/jstify/comments{/number}","issue_comment_url":"https://api.github.com/repos/zertosh/jstify/issues/comments{/number}","contents_url":"https://api.github.com/repos/zertosh/jstify/contents/{+path}","compare_url":"https://api.github.com/repos/zertosh/jstify/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zertosh/jstify/merges","archive_url":"https://api.github.com/repos/zertosh/jstify/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zertosh/jstify/downloads","issues_url":"https://api.github.com/repos/zertosh/jstify/issues{/number}","pulls_url":"https://api.github.com/repos/zertosh/jstify/pulls{/number}","milestones_url":"https://api.github.com/repos/zertosh/jstify/milestones{/number}","notifications_url":"https://api.github.com/repos/zertosh/jstify/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zertosh/jstify/labels{/name}","releases_url":"https://api.github.com/repos/zertosh/jstify/releases{/id}","created_at":"2014-02-18T06:01:25Z","updated_at":"2015-11-05T21:04:52Z","pushed_at":"2015-11-08T06:49:55Z","git_url":"git://github.com/zertosh/jstify.git","ssh_url":"git@github.com:zertosh/jstify.git","clone_url":"https://github.com/zertosh/jstify.git","svn_url":"https://github.com/zertosh/jstify","homepage":"","size":374,"stargazers_count":37,"watchers_count":37,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":3,"forks":11,"open_issues":3,"watchers":37,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zertosh/jstify/pulls/22"},"html":{"href":"https://github.com/zertosh/jstify/pull/22"},"issue":{"href":"https://api.github.com/repos/zertosh/jstify/issues/22"},"comments":{"href":"https://api.github.com/repos/zertosh/jstify/issues/22/comments"},"review_comments":{"href":"https://api.github.com/repos/zertosh/jstify/pulls/22/comments"},"review_comment":{"href":"https://api.github.com/repos/zertosh/jstify/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zertosh/jstify/pulls/22/commits"},"statuses":{"href":"https://api.github.com/repos/zertosh/jstify/statuses/683fecc4bc8871cc441fbeef7098a35e8d9553d0"}}}}