Comparing version
{ | ||
"name": "gulp-cond", | ||
"description": "Ternary operator for Gulp.", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"homepage": "https://github.com/nfroidure/gulp-cond", | ||
@@ -28,3 +28,5 @@ "author": { | ||
"scripts": { | ||
"test": "mocha tests/*.mocha.js" | ||
"test": "node_modules/mocha/bin/mocha tests/*.mocha.js", | ||
"coveralls": "./node_modules/istanbul/lib/cli.js cover ./node_modules/mocha/bin/_mocha --report lcovonly -- tests/*.mocha.js -R spec -t 5000 && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage", | ||
"cover": "./node_modules/istanbul/lib/cli.js cover --report html ./node_modules/mocha/bin/_mocha -- tests/*.mocha.js -R spec -t 5000" | ||
}, | ||
@@ -35,12 +37,17 @@ "keywords": [ | ||
"gulp-plugin", | ||
"font", | ||
"svg", | ||
"ttf", | ||
"converter" | ||
"condition", | ||
"operator", | ||
"ternary" | ||
], | ||
"devDependencies": { | ||
"gulp-util": "~2.2.14", | ||
"mocha": "~1.16.2", | ||
"event-stream": "~3.0.20" | ||
"mocha": "~1.18.2", | ||
"event-stream": "~3.1.1", | ||
"mocha-lcov-reporter": "0.0.1", | ||
"coveralls": "~2.10.0", | ||
"istanbul": "~0.2.6" | ||
}, | ||
"dependencies": { | ||
"readable-stream": "^1.0.26-2" | ||
} | ||
} |
@@ -1,4 +0,6 @@ | ||
# gulp-cond [](https://npmjs.org/package/gulp-cond) [](https://travis-ci.org/nfroidure/gulp-cond) | ||
# gulp-cond | ||
> A ternary operator for [Gulp](http://gulpjs.com/). | ||
[](https://npmjs.org/package/gulp-cond) [](https://travis-ci.org/nfroidure/gulp-cond) [](https://david-dm.org/nfroidure/gulp-cond) [](https://david-dm.org/nfroidure/gulp-cond#info=devDependencies) [](https://coveralls.io/r/nfroidure/gulp-cond?branch=master) | ||
## Usage | ||
@@ -72,2 +74,7 @@ | ||
## Stats | ||
[](https://nodei.co/npm/gulp-iconfont/) | ||
[](https://nodei.co/npm/gulp-iconfont/) | ||
### Contributing / Issues | ||
@@ -74,0 +81,0 @@ |
@@ -1,6 +0,5 @@ | ||
var Stream = require('stream'); | ||
var Stream = require('readable-stream'); | ||
const PLUGIN_NAME = 'gulp-cond'; | ||
// Plugin function | ||
@@ -14,5 +13,5 @@ function gulpCond(condition, expr1, expr2) { | ||
if(value) { | ||
outStream = expr1 instanceof Stream ? expr1 : expr1(); | ||
outStream = 'function' == typeof expr1 ? expr1() : expr1; | ||
} else if(expr2) { | ||
outStream = expr2 instanceof Stream ? expr2 : expr2(); | ||
outStream = 'function' == typeof expr2 ? expr2() : expr2; | ||
} else { | ||
@@ -19,0 +18,0 @@ outStream = new Stream.PassThrough({objectMode: true}); |
@@ -6,3 +6,3 @@ 'use strict'; | ||
, gulpCond = require(__dirname + '/../src/index.js') | ||
, Stream = require('stream') | ||
, Stream = require('readable-stream') | ||
, gutil = require('gulp-util') | ||
@@ -9,0 +9,0 @@ ; |
Sorry, the diff of this file is not supported yet
13040
10.13%84
9.09%1
Infinity%6
100%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added