lib/mock/index.js
function mockImplementation (req, res, next) {
    if (res.swagger) {
      // Determine the semantics of this request
      let request = new SemanticRequest(req);

      // Determine which mock to run
      let mock;
      if (request.isCollection) {
        mock = queryCollection[req.method] || editCollection[req.method];
      }
      else {
        mock = queryResource[req.method] || editResource[req.method];
      }

      // Get the current DataStore (this can be changed at any time by third-party code)
      let db = util.isExpressApp(router) ? router.get("mock data store") || dataStore : dataStore;
      db.__router = router;

      // Run the mock
      util.debug("Running the %s mock", mock.name);
      mock(req, res, next, db);
    }
    else {
      next();
    }
  }
function mockImplementation (req, res, next) {
    if (res.swagger) {
      // Determine the semantics of this request
      let request = new SemanticRequest(req);

      // Determine which mock to run
      let mock;
      if (request.isCollection) {
        mock = queryCollection[req.method] || editCollection[req.method];
      }
      else {
        mock = queryResource[req.method] || editResource[req.method];
      }

      // Get the current DataStore (this can be changed at any time by third-party code)
      let db = util.isExpressApp(router) ? router.get("mock data store") || dataStore : dataStore;
      db.__router = router;

      // Run the mock
      util.debug("Running the %s mock", mock.name);
      mock(req, res, next, db);
    }
    else {
      next();
    }
  }
function mockImplementation ( req , res , next ) { if ( res . swagger ) { // Determine the semantics of this request
 let request = new SemanticRequest ( req ) ; // Determine which mock to run
 let mock ; if ( request . isCollection ) { mock = queryCollection [ req . method ] || editCollection [ req . method ] ; } else { mock = queryResource [ req . method ] || editResource [ req . method ] ; } // Get the current DataStore (this can be changed at any time by third-party code)
 let db = util . isExpressApp ( router ) ? router . get ( "mock data store" ) || dataStore : dataStore ; db . __router = router ; // Run the mock
 util . debug ( "Running the %s mock" , mock . name ) ; mock ( req , res , next , db ) ; } else { next ( ) ; } }
Runs the appropriate mock implementation.
Runs the appropriate mock implementation .