Rename second isState flags in both chains to cacheState, so it's clear what they represent in the next callback

This commit is contained in:
Wes Mason
2016-05-06 09:28:22 +01:00
parent 4d4fa45266
commit 9ccb6063f8
+4 -4
View File
@@ -44,8 +44,8 @@ app.get( '/:package', function( req, res, next ){
return fetchAndCacheMetadata( packageName, cacheFile ); return fetchAndCacheMetadata( packageName, cacheFile );
} }
}) })
.then( function( isExists ){ .then( function( cacheState ){
if ( !isExists ) { if ( !cacheState ) {
return false; return false;
} }
res._log.cacheFile = cacheFile; res._log.cacheFile = cacheFile;
@@ -79,9 +79,9 @@ app.get( '/:package/-/:tarball', function( req, res, next ){
return fetchAndCacheTarball( packageName, version, packagePath ); return fetchAndCacheTarball( packageName, version, packagePath );
} }
}) })
.then( function( isExists ){ .then( function( cacheState ){
res._log.cacheFile = packagePath; res._log.cacheFile = packagePath;
if ( isExists ) { if ( cacheState ) {
return res.sendFile( packagePath ); return res.sendFile( packagePath );
} else { } else {
res.status( 404 ); res.status( 404 );