index.js
function next(err, done) {
    var layer = supply.layers[i++];

    if (err || done || !layer) {
      return fn(err, !!done);
    }

    if (layer.length > length) {
      return layer.fn.apply(supply.provider, args.concat(next));
    } else {
      dollars.catch(function catching() {
        return layer.fn.apply(supply.provider, args);
      }, next);
    }
  }
function next(err, done) {
    var layer = supply.layers[i++];

    if (err || done || !layer) {
      return fn(err, !!done);
    }

    if (layer.length > length) {
      return layer.fn.apply(supply.provider, args.concat(next));
    } else {
      dollars.catch(function catching() {
        return layer.fn.apply(supply.provider, args);
      }, next);
    }
  }
function next ( err , done ) { var layer = supply . layers [ i ++ ] ; if ( err || done || ! layer ) { return fn ( err , ! ! done ) ; } if ( layer . length > length ) { return layer . fn . apply ( supply . provider , args . concat ( next ) ) ; } else { dollars . catch ( function catching ( ) { return layer . fn . apply ( supply . provider , args ) ; } , next ) ; } }
Simple middleware layer iterator.

@param {Error} err A failed middleware iteration.
@param {Boolean} done Stop iterating the layers as we are done.
@api private
Simple middleware layer iterator .