From 9ccb6063f8617bad1fb2b5cff16b66c3f5ee4da0 Mon Sep 17 00:00:00 2001 From: Wes Mason Date: Fri, 6 May 2016 09:28:22 +0100 Subject: [PATCH] Rename second isState flags in both chains to cacheState, so it's clear what they represent in the next callback --- app.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app.js b/app.js index 49524d9..dc5f6d7 100644 --- a/app.js +++ b/app.js @@ -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 );