Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,8 @@ function isLicenseFile(filePath, coordinates) {
if (_licenseFileNames.includes(basePath)) return true
if (!coordinates) return false
for (const prefix of getLicenseLocations(coordinates) || []) {
if (_licenseFileNames.includes(filePath.replace(prefix, ''))) return true
const prefixLowered = prefix.toLowerCase()
if (_licenseFileNames.includes(filePath.replace(prefixLowered, ''))) return true
}
return false
}
Expand All @@ -338,7 +339,13 @@ function isDeclaredLicense(identifier) {
}

function getLicenseLocations(coordinates) {
const map = { npm: ['package/'], maven: ['meta-inf/'], pypi: [`${coordinates.name}-${coordinates.revision}/`], go: [goLicenseLocations(coordinates)] }
const map = {
npm: ['package/'],
maven: ['META-INF/'],
pypi: [`${coordinates.name}-${coordinates.revision}/`],
go: [goLicenseLocations(coordinates)]
}
map.sourcearchive = map.maven
return map[coordinates.type]
}

Expand Down
Loading