forked from enviPath/enviPy
Current Dev State
This commit is contained in:
20
static/js/ketcher2/node_modules/gulp-cond/src/index.js
generated
vendored
Normal file
20
static/js/ketcher2/node_modules/gulp-cond/src/index.js
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
var Stream = require('readable-stream');
|
||||
|
||||
var PLUGIN_NAME = 'gulp-cond';
|
||||
|
||||
function gulpCond(condition, expr1, expr2) {
|
||||
var value = 'function' == typeof condition ? condition() : condition;
|
||||
var outStream;
|
||||
|
||||
if(value) {
|
||||
outStream = 'function' == typeof expr1 ? expr1() : expr1;
|
||||
} else if(expr2) {
|
||||
outStream = 'function' == typeof expr2 ? expr2() : expr2;
|
||||
} else {
|
||||
outStream = new Stream.PassThrough({objectMode: true});
|
||||
}
|
||||
|
||||
return outStream;
|
||||
};
|
||||
|
||||
module.exports = gulpCond;
|
||||
Reference in New Issue
Block a user