src/http/http.js
function parseAhead( router, req, done ) {
	var idx = 0;
	var stack = router.stack;
	var params = {};
	var method = req.method ? req.method.toLowerCase() : undefined;
	next();

	function next() {
		var layer = stack[ idx++ ];
		if ( !layer ) {
			// strip dangling query params
			params = _.transform( params, function( acc, v, k ) {
				acc[ k ] = v.split( '?' )[ 0 ]; return acc;
			}, {} );
			return done( params );
		}

		if ( layer.method && layer.method !== method ) {
			return next();
		}
		layer.match( req.originalUrl );
		params = _.merge( params, layer.params );
		next();
	}
}
function parseAhead( router, req, done ) {
	var idx = 0;
	var stack = router.stack;
	var params = {};
	var method = req.method ? req.method.toLowerCase() : undefined;
	next();

	function next() {
		var layer = stack[ idx++ ];
		if ( !layer ) {
			// strip dangling query params
			params = _.transform( params, function( acc, v, k ) {
				acc[ k ] = v.split( '?' )[ 0 ]; return acc;
			}, {} );
			return done( params );
		}

		if ( layer.method && layer.method !== method ) {
			return next();
		}
		layer.match( req.originalUrl );
		params = _.merge( params, layer.params );
		next();
	}
}
function parseAhead ( router , req , done ) { var idx = 0 ; var stack = router . stack ; var params = { } ; var method = req . method ? req . method . toLowerCase ( ) : undefined ; next ( ) ; function next ( ) { var layer = stack [ idx ++ ] ; if ( ! layer ) { // strip dangling query params params = _ . transform ( params , function ( acc , v , k ) { acc [ k ] = v . split ( '?' ) [ 0 ] ; return acc ; } , { } ) ; return done ( params ) ; } if ( layer . method && layer . method !== method ) { return next ( ) ; } layer . match ( req . originalUrl ) ; params = _ . merge ( params , layer . params ) ; next ( ) ; } }
this might be the worst thing to ever happen to anything ever this is adapted directly from express layer.match
this might be the worst thing to ever happen to anything ever this is adapted directly from express layer . match