(results, licenseMap)
| 33 | } |
| 34 | |
| 35 | function 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 | |
| 48 | function parseYarnLock(lockfilePath) { |
| 49 | const content = fs.readFileSync(lockfilePath, "utf-8"); |