{"action":"created","issue":{"url":"https://api.github.com/repos/robrich/gulp-if/issues/37","labels_url":"https://api.github.com/repos/robrich/gulp-if/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/robrich/gulp-if/issues/37/comments","events_url":"https://api.github.com/repos/robrich/gulp-if/issues/37/events","html_url":"https://github.com/robrich/gulp-if/issues/37","id":40542757,"number":37,"title":"Support array of conditions","user":{"login":"terinjokes","id":273509,"avatar_url":"https://avatars.githubusercontent.com/u/273509?v=3","gravatar_id":"","url":"https://api.github.com/users/terinjokes","html_url":"https://github.com/terinjokes","followers_url":"https://api.github.com/users/terinjokes/followers","following_url":"https://api.github.com/users/terinjokes/following{/other_user}","gists_url":"https://api.github.com/users/terinjokes/gists{/gist_id}","starred_url":"https://api.github.com/users/terinjokes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/terinjokes/subscriptions","organizations_url":"https://api.github.com/users/terinjokes/orgs","repos_url":"https://api.github.com/users/terinjokes/repos","events_url":"https://api.github.com/users/terinjokes/events{/privacy}","received_events_url":"https://api.github.com/users/terinjokes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2014-08-18T23:15:48Z","updated_at":"2015-12-07T16:43:29Z","closed_at":null,"body":"One currently has multiple options to support multiple conditions with `gulp-if`:\r\n\r\n```javascript\r\ngif(PRODUCTION, gif('*.js', minify()));\r\n```\r\n\r\n```javascript\r\ngif(function(file) { return PRODUCTION && gulpmatch(file, '*.js'); }, minify());\r\n```\r\n\r\nBut all of these (and more involving `lazypipe`), distract from the goal of this simple problem: matching a boolean condition with a glob condition.\r\n\r\nI propose something similar to the following to allow multiple conditions without nesting `gulp-if` instances:\r\n\r\n```javascript\r\ngif([PRODUCTION, '*.js'], minify());\r\n```\r\n\r\nI don't believe the above will work as is because it conflicts with the multiple glob support in `gulp-match`, but it's the general idea of what i've got."},"comment":{"url":"https://api.github.com/repos/robrich/gulp-if/issues/comments/162586671","html_url":"https://github.com/robrich/gulp-if/issues/37#issuecomment-162586671","issue_url":"https://api.github.com/repos/robrich/gulp-if/issues/37","id":162586671,"user":{"login":"mix3d","id":1474137,"avatar_url":"https://avatars.githubusercontent.com/u/1474137?v=3","gravatar_id":"","url":"https://api.github.com/users/mix3d","html_url":"https://github.com/mix3d","followers_url":"https://api.github.com/users/mix3d/followers","following_url":"https://api.github.com/users/mix3d/following{/other_user}","gists_url":"https://api.github.com/users/mix3d/gists{/gist_id}","starred_url":"https://api.github.com/users/mix3d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mix3d/subscriptions","organizations_url":"https://api.github.com/users/mix3d/orgs","repos_url":"https://api.github.com/users/mix3d/repos","events_url":"https://api.github.com/users/mix3d/events{/privacy}","received_events_url":"https://api.github.com/users/mix3d/received_events","type":"User","site_admin":false},"created_at":"2015-12-07T16:43:29Z","updated_at":"2015-12-07T16:43:29Z","body":"Perhaps then the \"easiest\" solution then, would be to provide examples of multi-conditional external functions, added as a pattern in the README? If the file object is always available, it is less work to @robrich to \"implement\".\r\n\r\nOtherwise, while I don't know enough about what is kosher in terms of the multi file glob pattern, but mixing booleans with strings in an array, and checking them internally, sounds like an anti-pattern. Similarly, using an array of strings, conditionals, and/or string arrays (for the glob array), leaves you with nested arrays, and the likelihood of people accidentally assuming the array is flat, even if that inherently gets you an \"or\" pattern with anything in a sub array (assuming the sub array is a glob array and not mixed.)\r\n\r\nQuite the rabbit hole!"}}