lib/base-middleware.js
function BaseMiddleware (Model, key) {
  // constructor
  var instance = function (req, res, next) {
    return instance.exec()(req, res, next);
  };
  instance.Model = Model;
  instance.methodChain = [];

  instance.__proto__ = this.__proto__;

  instance.setKey = function (key) {
    key = key || Model.modelName.toLowerCase();
    instance.modelKey = inflect.singularize(key);
    instance.collectionKey = inflect.pluralize(key);
  };
  instance.setKey(key);
  return instance;
}
function BaseMiddleware (Model, key) {
  // constructor
  var instance = function (req, res, next) {
    return instance.exec()(req, res, next);
  };
  instance.Model = Model;
  instance.methodChain = [];

  instance.__proto__ = this.__proto__;

  instance.setKey = function (key) {
    key = key || Model.modelName.toLowerCase();
    instance.modelKey = inflect.singularize(key);
    instance.collectionKey = inflect.pluralize(key);
  };
  instance.setKey(key);
  return instance;
}
function BaseMiddleware ( Model , key ) { // constructor var instance = function ( req , res , next ) { return instance . exec ( ) ( req , res , next ) ; } ; instance . Model = Model ; instance . methodChain = [ ] ; instance . __proto__ = this . __proto__ ; instance . setKey = function ( key ) { key = key || Model . modelName . toLowerCase ( ) ; instance . modelKey = inflect . singularize ( key ) ; instance . collectionKey = inflect . pluralize ( key ) ; } ; instance . setKey ( key ) ; return instance ; }
uses Model and key from closure
@param {Object} Model
@param {String} key
@return {Object}
uses Model and key from closure