MCPcopy Create free account
hub / github.com/scriptscat/scriptcat / dealFile

Method dealFile

src/pkg/backup/import.ts:239–248  ·  view source on GitHub ↗
(files: FileInfo[], handler: (file: FileInfo) => Promise<boolean>)

Source from the content-addressed store, hash-verified

237 }
238
239 async dealFile(files: FileInfo[], handler: (file: FileInfo) => Promise<boolean>): Promise<FileInfo[]> {
240 const newFiles: FileInfo[] = [];
241 const results = await Promise.all(files.map(handler));
242 results.forEach((result, index) => {
243 if (!result) {
244 newFiles.push(files[index]);
245 }
246 });
247 return newFiles;
248 }
249}

Callers 1

parseMethod · 0.95

Calls 2

forEachMethod · 0.80
pushMethod · 0.80

Tested by

no test coverage detected