(dir, cb)
| 171 | // Opendir read result using callback |
| 172 | |
| 173 | function processDirCb(dir, cb) { |
| 174 | const acc = []; |
| 175 | |
| 176 | function _process(dir, acc, cb) { |
| 177 | dir.read((err, dirent) => { |
| 178 | if (err) { |
| 179 | return cb(err); |
| 180 | } |
| 181 | |
| 182 | if (dirent !== null) { |
| 183 | acc.push(dirent); |
| 184 | _process(dir, acc, cb); |
| 185 | } else { |
| 186 | cb(null, acc); |
| 187 | } |
| 188 | }); |
| 189 | } |
| 190 | |
| 191 | _process(dir, acc, cb); |
| 192 | } |
| 193 | |
| 194 | { |
| 195 | const dir = fs.opendirSync(testDir, { recursive: true }); |
no test coverage detected
searching dependent graphs…