Skip to content

Commit

Permalink
map ignores only once in list
Browse files Browse the repository at this point in the history
  • Loading branch information
rafapaezbas committed Aug 26, 2024
1 parent ae2189f commit 55283cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ module.exports = class Localdrive {
folder = undefined
}

const ignore = opts.ignore ? [].concat(opts.ignore) : []
const ignore = opts.ignore ? [].concat(opts.ignore).map(e => unixPathResolve('/', e)) : []
const { keyname, filename: fulldir } = this._resolve(folder || '/')
const iterator = await opendir(fulldir)

Expand All @@ -202,7 +202,7 @@ module.exports = class Localdrive {
for await (const dirent of iterator) {
const key = unixPathResolve(keyname, dirent.name)

if (ignore.map(e => unixPathResolve('/', e)).includes(key)) continue
if (ignore.includes(key)) continue

if (dirent.isDirectory()) {
yield * this.list(key, opts)
Expand Down

0 comments on commit 55283cd

Please sign in to comment.