Skip to content

Commit d078690

Browse files
committed
possible fix for node 19.x
1 parent e8ae487 commit d078690

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/find-plus.mjs

+6
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ const find = async(params = {}) => {
6161
const files = await fs.readdir(dirPath, { withFileTypes : true })
6262
for (const file of files) {
6363
file.depth = currDepth
64+
65+
// node 19.x DirEnt's lack parent path
66+
if (file.parentPath === undefined) {
67+
file.parentPath = dirPath
68+
}
69+
6470
const pass = !myTests.some((t) => !t(file, currDepth))
6571

6672
if (file.isDirectory() && (pass || noTraverseFailed === false)) {

0 commit comments

Comments
 (0)