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

Function serializeHashManifest

tasks/bundle-signature.js:10–33  ·  view source on GitHub ↗
(entries)

Source from the content-addressed store, hash-verified

8import {copyFile, getPaths, readJSON, writeFile, fileExists} from './utils.js';
9
10function serializeHashManifest(entries) {
11 const lines = [];
12 lines.push('Manifest-Version: 1.0');
13 for (const {archivePath, integrity} of entries) {
14 lines.push('');
15 lines.push(`Name: ${archivePath}`);
16
17 lines.push(`Digest-Algorithms:${integrity.md5 ? ' MD5' : ''}${integrity.sha1 ? ' SHA1' : ''}${integrity.sha256 ? ' SHA256' : ''}`);
18 if (integrity.md5) {
19 lines.push(`MD5-Digest: ${integrity.md5}`);
20 }
21 if (integrity.sha1) {
22 lines.push(`SHA1-Digest: ${integrity.sha1}`);
23 }
24 if (integrity.sha256) {
25 lines.push(`SHA256-Digest: ${integrity.sha256}`);
26 }
27 }
28
29 lines.push('');
30 lines.push('');
31
32 return lines.join('\n');
33}
34
35async function enumerateStandardPaths(dir, order) {
36 const path = `./${dir}`;

Callers 1

createHashesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected