Make purl comparisons case insensitive
This commit is contained in:
+12
-4
@@ -1151,11 +1151,15 @@ function fullName(purl) {
|
||||
// namespace/name splits. This handles the case where a PURL like
|
||||
// 'pkg:npm/%40scope%2Fname' is parsed as {namespace: null, name: '@scope/name'}
|
||||
// while 'pkg:npm/%40scope/name' is parsed as {namespace: '@scope', name: 'name'}.
|
||||
//
|
||||
// The comparison is case-insensitive because most ecosystems and registries
|
||||
// treat names that way (npm, PyPI, GitHub org/repo names, etc.).
|
||||
function purlsMatch(a, b) {
|
||||
if (a.type !== b.type) {
|
||||
var _a, _b;
|
||||
if (a.type.toLowerCase() !== b.type.toLowerCase()) {
|
||||
return false;
|
||||
}
|
||||
return fullName(a) === fullName(b);
|
||||
return ((_a = fullName(a)) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === ((_b = fullName(b)) === null || _b === void 0 ? void 0 : _b.toLowerCase());
|
||||
}
|
||||
|
||||
|
||||
@@ -98064,11 +98068,15 @@ function fullName(purl) {
|
||||
// namespace/name splits. This handles the case where a PURL like
|
||||
// 'pkg:npm/%40scope%2Fname' is parsed as {namespace: null, name: '@scope/name'}
|
||||
// while 'pkg:npm/%40scope/name' is parsed as {namespace: '@scope', name: 'name'}.
|
||||
//
|
||||
// The comparison is case-insensitive because most ecosystems and registries
|
||||
// treat names that way (npm, PyPI, GitHub org/repo names, etc.).
|
||||
function purlsMatch(a, b) {
|
||||
if (a.type !== b.type) {
|
||||
var _a, _b;
|
||||
if (a.type.toLowerCase() !== b.type.toLowerCase()) {
|
||||
return false;
|
||||
}
|
||||
return fullName(a) === fullName(b);
|
||||
return ((_a = fullName(a)) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === ((_b = fullName(b)) === null || _b === void 0 ? void 0 : _b.toLowerCase());
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user