MCPcopy
hub / github.com/flowjs/flow.js / readDirectory

Function readDirectory

src/flow.js:248–267  ·  view source on GitHub ↗
(reader)

Source from the content-addressed store, hash-verified

246 }
247 });
248 function readDirectory(reader) {
249 reader.readEntries(function (entries) {
250 if (entries.length) {
251 queue += entries.length;
252 each(entries, function(entry) {
253 if (entry.isFile) {
254 var fullPath = entry.fullPath;
255 entry.file(function (file) {
256 fileReadSuccess(file, fullPath);
257 }, readError);
258 } else if (entry.isDirectory) {
259 readDirectory(entry.createReader());
260 }
261 });
262 readDirectory(reader);
263 } else {
264 decrement();
265 }
266 }, readError);
267 }
268 function fileReadSuccess(file, fullPath) {
269 // relative path should not start with "/"
270 file.relativePath = fullPath.substring(1);

Callers 1

flow.jsFile · 0.85

Calls 3

eachFunction · 0.85
fileReadSuccessFunction · 0.85
decrementFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…