@@ -189,7 +189,7 @@ const applicable = (decodedPath, configEntry, negative) => {
189
189
let matches = negative ? false : true ;
190
190
191
191
if ( typeof configEntry !== 'undefined' ) {
192
- matches = ( configEntry === ! negative ) ;
192
+ matches = ( configEntry === ! matches ) ;
193
193
194
194
if ( ! matches && Array . isArray ( configEntry ) ) {
195
195
// This is much faster than `.some`
@@ -242,13 +242,7 @@ const findRelated = async (current, relativePath, stat, extension = '.html') =>
242
242
243
243
// At this point, no `.html` files have been found, so we
244
244
// need to check for the existance of `.htm` ones.
245
- const relatedHTM = findRelated ( current , relativePath , stat , '.htm' ) ;
246
-
247
- if ( relatedHTM ) {
248
- return relatedHTM ;
249
- }
250
-
251
- return null ;
245
+ return findRelated ( current , relativePath , stat , '.htm' ) ;
252
246
} ;
253
247
254
248
const canBeListed = ( excluded , file ) => {
@@ -382,11 +376,7 @@ const renderDirectory = async (current, acceptsJSON, handlers, config, paths) =>
382
376
paths : subPaths
383
377
} ;
384
378
385
- if ( acceptsJSON ) {
386
- return JSON . stringify ( spec ) ;
387
- }
388
-
389
- return template ( spec ) ;
379
+ return acceptsJSON ? JSON . stringify ( spec ) : template ( spec ) ;
390
380
} ;
391
381
392
382
module . exports = async ( request , response , config = { } , methods = { } ) => {
0 commit comments