| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 8d485f1 commit 4cc0493
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1530,6 +1530,9 @@ function readdir(path, options, callback) { | |||
| 1530 | 1530 | } | |
| 1531 | 1531 | ||
| 1532 | 1532 | if (options.recursive) { | |
| 1533 | + // Make shallow copy to prevent mutating options from affecting results | ||
| 1534 | + options = copyObject(options); | ||
| 1535 | + | ||
| 1533 | 1536 | readdirRecursive(path, options, callback); | |
| 1534 | 1537 | return; | |
| 1535 | 1538 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -86,6 +86,14 @@ fs.readdir(readdirDir, { | |||
| 86 | 86 | assertDirents(await direntsPromise); | |
| 87 | 87 | })().then(common.mustCall()); | |
| 88 | 88 | ||
| 89 | + { | ||
| 90 | + const options = { recursive: true, withFileTypes: true }; | ||
| 91 | + fs.readdir(readdirDir, options, common.mustSucceed((dirents) => { | ||
| 92 | + assertDirents(dirents); | ||
| 93 | + })); | ||
| 94 | + options.withFileTypes = false; | ||
| 95 | + } | ||
| 96 | + | ||
| 89 | 97 | // Check for correct types when the binding returns unknowns | |
| 90 | 98 | const UNKNOWN = constants.UV_DIRENT_UNKNOWN; | |
| 91 | 99 | const oldReaddir = binding.readdir; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments