amercier / files-by-directory

NodeJS library to list files by directory, recursively, using asynchronous iteration (for-await-of).
ISC License
2 stars 0 forks source link

Descendant paths detection #4

Closed amercier closed 5 years ago

amercier commented 5 years ago

Summary

This PR improves double/descendant path detection in filesByDirectory().

Problem

# Directory structure:
root
├── file1
└── file2
for await (const files of filesByDirectory(['root', 'root/file1'])) {
  console.log(files);
}

Expected result

['root/file1', 'root/file2']

Actual result

['root/file1', 'root/file2']
['root/file1']