MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / processEntry

Function processEntry

wasm/reset_events.js:162–182  ·  view source on GitHub ↗
(entry)

Source from the content-addressed store, hash-verified

160 if (Object.keys(entriesTree).length == 0) finalize();
161 };
162 var processEntry = function (entry) {
163 let fp = entry.fullPath;
164 let pp = fp.substring(0, fp.lastIndexOf('/'));
165 entriesTree[fp] = { subpaths: [] };
166 if (entry.isFile) {
167 entry.file((f) => { filesQ.push({ file: f, path: pp }); markDone(fp, false); })
168 } else if (entry.isDirectory) {
169 if (entriesTree.hasOwnProperty(pp)) entriesTree[pp].subpaths.push(fp);
170 FS.createPath("/" + drop_dir + pp, entry.name);
171 var reader = entry.createReader();
172 var rRead = function (dirEntries) {
173 if (dirEntries.length == 0) {
174 markDone(fp, true);
175 return;
176 }
177 for (const ent of dirEntries) processEntry(ent);
178 reader.readEntries(rRead);
179 };
180 reader.readEntries(rRead);
181 }
182 };
183 for (const item of event.dataTransfer.items) {
184 processEntry(item.webkitGetAsEntry());
185 }

Callers 2

rReadFunction · 0.85
drop_files_or_dirFunction · 0.85

Calls 2

markDoneFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected