setup-node/node_modules/yargs/lib/middleware.js
eric sciple 422b9fdb15 .
2020-01-24 12:21:24 -05:00

10 lines
301 B
JavaScript

module.exports = function (globalMiddleware, context) {
return function (callback) {
if (Array.isArray(callback)) {
Array.prototype.push.apply(globalMiddleware, callback)
} else if (typeof callback === 'function') {
globalMiddleware.push(callback)
}
return context
}
}