build-boiler
Version:
Build Boilerplate using Webpack, Eslint, Assemble, Nunjucks, and BrowserSync
37 lines (25 loc) • 925 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = function (ogFn, fn, cb) {
fn = fn || ogFn;
if (!_lodash2.default.isFunction(cb)) return (0, _isStream2.default)(fn) ? fn : fn();
if (cb && fn.length === 0) throw new Error('A `cb` must be passed to the custom task funtion');
fn(cb);
};
var _lodash = require('lodash');
var _lodash2 = _interopRequireDefault(_lodash);
var _isStream = require('./is-stream');
var _isStream2 = _interopRequireDefault(_isStream);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
module.exports = exports['default'];
/**
* Utility for calling parent function
* a) this is a gulp stream so just return it
* b) this is an asynchronus or non-streaming task => call with `cb`
* @param {Function} fn parent function
* @param {Function} cb gulp cb
*
* @return {Stream|undefined}
*/