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 );
}
})
.then( function( isExists ){
if ( !isExists ) {
.then( function( cacheState ){
if ( !cacheState ) {
return false;
}
res._log.cacheFile = cacheFile;
@@ -79,9 +79,9 @@ app.get( '/:package/-/:tarball', function( req, res, next ){
return fetchAndCacheTarball( packageName, version, packagePath );
}
})
.then( function( isExists ){
.then( function( cacheState ){
res._log.cacheFile = packagePath;
if ( isExists ) {
if ( cacheState ) {
return res.sendFile( packagePath );
} else {
res.status( 404 );