lib/index.js
function use(type) {
    // Convert args to array.
    var args = Array.prototype.slice.call(arguments);

    // Check if type not provided.
    if ('string' !== typeof type && type instanceof Array === false) {
      type = [];
    } else {
      if ('string' === typeof type) {
        //wrap string in array to homogenize handling
        type = [type];
      }
      args.shift();
    }

    args.forEach(function(arg){
      stack.push({type: type, cb: arg});
    });

    return middlebot;
  }
function use(type) {
    // Convert args to array.
    var args = Array.prototype.slice.call(arguments);

    // Check if type not provided.
    if ('string' !== typeof type && type instanceof Array === false) {
      type = [];
    } else {
      if ('string' === typeof type) {
        //wrap string in array to homogenize handling
        type = [type];
      }
      args.shift();
    }

    args.forEach(function(arg){
      stack.push({type: type, cb: arg});
    });

    return middlebot;
  }
function use ( type ) { // Convert args to array. var args = Array . prototype . slice . call ( arguments ) ; // Check if type not provided. if ( 'string' !== typeof type && type instanceof Array === false ) { type = [ ] ; } else { if ( 'string' === typeof type ) { //wrap string in array to homogenize handling type = [ type ] ; } args . shift ( ) ; } args . forEach ( function ( arg ) { stack . push ( { type : type , cb : arg } ) ; } ) ; return middlebot ; }
Add a middleware in the stack for the given
type.

@param {*} type the handler type where to use
the middleware. If not provided, middleware is always
used. Can be either a string or an array of string
@param {function} middlewares
@returns the middlebot instance
Add a middleware in the stack for the given type .