MCPcopy Create free account
hub / github.com/sourcebot-dev/sourcebot / applyLicenseMap

Function applyLicenseMap

scripts/fetchLicenses.mjs:35–46  ·  view source on GitHub ↗
(results, licenseMap)

Source from the content-addressed store, hash-verified

33}
34
35function applyLicenseMap(results, licenseMap) {
36 let overrideCount = 0;
37 for (const result of results) {
38 const mapping = licenseMap[result.name];
39 if (!mapping) continue;
40 if (deepEqual(result.license, mapping.old)) {
41 result.license = mapping.new;
42 overrideCount++;
43 }
44 }
45 return overrideCount;
46}
47
48function parseYarnLock(lockfilePath) {
49 const content = fs.readFileSync(lockfilePath, "utf-8");

Callers 1

mainFunction · 0.85

Calls 1

deepEqualFunction · 0.85

Tested by

no test coverage detected