Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ define([
// leaving the slash in the result. If there is no slash in the path - the path
// is just a file name, it will return `undefined`.
function parentDir (path) {
if (path[path.length - 1] === '/') {
path = path.substring(0, path.length - 1)
}
var lastSlash = path.lastIndexOf('/');
return lastSlash > 0 ? path.substring(0, lastSlash + 1) : undefined;
}
Expand Down