aswi2020vldc-gitlab/templetes/node_modules/yargs/lib/middleware.js @ 3a515b92
1 | 3a515b92 | cagy | module.exports = function (globalMiddleware, context) { |
---|---|---|---|
2 | return function (callback) { |
||
3 | if (Array.isArray(callback)) { |
||
4 | Array.prototype.push.apply(globalMiddleware, callback) |
||
5 | } else if (typeof callback === 'function') { |
||
6 | globalMiddleware.push(callback) |
||
7 | }
|
||
8 | return context |
||
9 | }
|
||
10 | }
|