1
0
CompleteNodeJS/notes-app/node_modules/yargs/lib/middleware.js
Jason Williams 6528d7204a Section 20
2019-08-11 12:15:16 -06:00

11 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
}
}