You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

10 lines
301 B

4 years ago
  1. 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. }