Permalink
Browse files

Trim trailing slash on dirPath

  • Loading branch information...
1 parent 0413236 commit 3651804869cabc2356571be786b1493685fe2f8c @nicjansma nicjansma committed Jun 20, 2013
Showing with 5 additions and 0 deletions.
  1. +5 −0 lib/map-path.js
View
@@ -25,6 +25,11 @@ module.exports = function(dirPath, params, callback) {
return callback(new Error('Path is required'))
}
+ // trim trailing slash
+ if (dirPath.substring(dirPath.length - 1) === '/') {
+ dirPath = dirPath.slice(0, -1);
+ }
+
function hash(filename, callback) {
var
md5sum = crypto.createHash('md5'),

0 comments on commit 3651804

Please sign in to comment.