mirror of
https://github.com/harish2704/npm-offline-registry.git
synced 2026-09-10 06:21:09 +00:00
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:
@@ -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 );
|
||||||
|
|||||||
Reference in New Issue
Block a user