Skip to content

Commit 4e890a6

Browse files
authored
Merge pull request #56 from arduino/bugfix/hide-symlink
Bugfix/hide symlink
2 parents c6066fd + eacaa4f commit 4e890a6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,19 @@ function listFolder(folder) {
2222
return files
2323
}
2424

25-
function ilistFolder(folder, filesOnly) {
25+
function ilistFolder(folder) {
2626
let files = fs.readdirSync(path.resolve(folder))
27+
files = files.filter(f => {
28+
let filePath = path.resolve(folder, f)
29+
return !fs.lstatSync(filePath).isSymbolicLink()
30+
})
2731
files = files.map(f => {
2832
let filePath = path.resolve(folder, f)
2933
return {
3034
path: f,
3135
type: fs.lstatSync(filePath).isDirectory() ? 'folder' : 'file'
3236
}
3337
})
34-
// Filter out directories
35-
if (filesOnly) {
36-
files = files.filter(f => f.type === 'file')
37-
}
3838
// Filter out dot files
3939
files = files.filter(f => f.path.indexOf('.') !== 0)
4040
return files

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy