Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

directory middleware: fix: error for invalid sorting option

  • Loading branch information...
commit 30f4bf94fcdb0b882e455abbaaa56f3b2f2b251f 1 parent 839325f
Pavel Lang authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/middleware/directory.js
5 lib/middleware/directory.js
View
@@ -67,7 +67,8 @@ exports = module.exports = function directory(root, options){
sort = exports.sortMethods[sort];
if(!sort)
throw new Error('Invalid sort function name: ' + sort +
- '\nValid ones are: ' + Object.keys().join(', ') +
+ '\nValid ones are: ' +
+ Object.keys(exports.sortMethods).join(', ') +
'\nor custom function');
}
@@ -123,7 +124,7 @@ exports = module.exports = function directory(root, options){
error: err
});
}
- // finis the job if after all files stated
+ // finish the job if all files stated
pending--;
if (pending === 0) {
if(sort && sort.needStat)
Please sign in to comment.
Something went wrong with that request. Please try again.