Skip to content

Commit

Permalink
Use simpler glob format parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
perry-mitchell committed Mar 2, 2019
1 parent 966fd52 commit 493636b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions source/interface/directoryContents.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ function getDirectoryContents(remotePath, options) {
.then(parseXML)
.then(result => getDirectoryFiles(result, options.remotePath, remotePath, options.details))
.then(files => processResponsePayload(response, files, options.details))
.then(files => options.glob && options.glob.pattern ? processGlobFilter(files, options.glob) : files)
;
.then(files => (options.glob ? processGlobFilter(files, options.glob) : files));
}

function getDirectoryFiles(result, serverBasePath, requestPath, isDetailed = false) {
Expand Down
2 changes: 1 addition & 1 deletion source/response.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function handleResponseCode(response) {
}

function processGlobFilter(files, glob) {
return files.filter(file => minimatch(file.filename, glob.pattern, { matchBase: true }));
return files.filter(file => minimatch(file.filename, glob, { matchBase: true }));
}

function processResponsePayload(response, data, isDetailed = false) {
Expand Down

0 comments on commit 493636b

Please sign in to comment.