MCPcopy Index your code
hub / github.com/darkreader/darkreader / enumerateStandardPaths

Function enumerateStandardPaths

tasks/bundle-signature.js:35–56  ·  view source on GitHub ↗
(dir, order)

Source from the content-addressed store, hash-verified

33}
34
35async function enumerateStandardPaths(dir, order) {
36 const path = `./${dir}`;
37 let realPaths = await getPaths(path);
38 realPaths = realPaths.sort();
39 let completeRealPaths = realPaths.map((realPath) => ({
40 realPath,
41 archivePath: realPath.substring(dir.length + 1),
42 }));
43 completeRealPaths = completeRealPaths.filter(({archivePath}) => archivePath !== 'manifest.json' && !archivePath.startsWith('META-INF/'));
44
45 // Re-order paths if needed
46 if (order) {
47 const correctPaths = [];
48 for (let i = 0; i < order.length; i++) {
49 correctPaths[i] = completeRealPaths[order[i]];
50 }
51 completeRealPaths = correctPaths;
52 }
53
54 // manifest.json always comes first
55 return completeRealPaths;
56}
57
58function calculateHashForData(hashes, data) {
59 const digests = {};

Callers 1

createHashesFunction · 0.85

Calls 1

getPathsFunction · 0.90

Tested by

no test coverage detected