(dir, order)
| 33 | } |
| 34 | |
| 35 | async 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 | |
| 58 | function calculateHashForData(hashes, data) { |
| 59 | const digests = {}; |
no test coverage detected