@cyclonedx/cyclonedx-library 1.3.3 → 1.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -44,14 +44,20 @@ class PackageUrlFactory {
|
|
|
44
44
|
makeFromComponent(component, sort = false) {
|
|
45
45
|
const qualifiers = {};
|
|
46
46
|
let subpath;
|
|
47
|
-
const extRefs =
|
|
48
|
-
|
|
47
|
+
const extRefs = sort
|
|
48
|
+
? component.externalReferences.sorted()
|
|
49
|
+
: component.externalReferences;
|
|
50
|
+
for (const extRef of extRefs) {
|
|
51
|
+
const url = extRef.url.toString();
|
|
52
|
+
if (url.length <= 0) {
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
49
55
|
switch (extRef.type) {
|
|
50
56
|
case enums_1.ExternalReferenceType.VCS:
|
|
51
|
-
[qualifiers.vcs_url, subpath] =
|
|
57
|
+
[qualifiers.vcs_url, subpath] = url.split('#', 2);
|
|
52
58
|
break;
|
|
53
59
|
case enums_1.ExternalReferenceType.Distribution:
|
|
54
|
-
qualifiers.download_url =
|
|
60
|
+
qualifiers.download_url = url;
|
|
55
61
|
break;
|
|
56
62
|
}
|
|
57
63
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageUrl.js","sourceRoot":"","sources":["../../src/factories/packageUrl.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;EAiBE;;;;;;;;;;;;;;;AAGF,iDAA0C;AAC1C,oCAAgD;AAEhD,MAAa,iBAAiB;IAG5B,YAAa,IAA+B;QAF5C,0CAAkC;QAGhC,uBAAA,IAAI,2BAAS,IAAI,MAAA,CAAA;IACnB,CAAC;IAED,IAAI,IAAI;QACN,OAAO,uBAAA,IAAI,+BAAM,CAAA;IACnB,CAAC;IAED,iBAAiB,CAAE,SAAoB,EAAE,OAAgB,KAAK;QAK5D,MAAM,UAAU,GAA6B,EAAE,CAAA;QAC/C,IAAI,OAA8B,CAAA;
|
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C,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM,EAC/B,CAAC,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,EAAE,CAAC,GAAG,QAAQ,CAAC,WAAW,EAAE,IAAI,QAAQ,CAAC,WAAW,EAAE,EAAE,CAChF,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;SACZ;QAED,IAAI;YAGF,OAAO,IAAI,0BAAU,CACnB,uBAAA,IAAI,+BAAM,EACV,SAAS,CAAC,KAAK,EACf,SAAS,CAAC,IAAI,EACd,SAAS,CAAC,OAAO,EACjB,UAAU,EACV,OAAO,CACR,CAAA;SACF;QAAC,MAAM;YACN,OAAO,SAAS,CAAA;SACjB;IACH,CAAC;CACF;AAjED,8CAiEC"}
|
package/dist.web/lib.dev.js
CHANGED
|
@@ -479,14 +479,20 @@ class PackageUrlFactory {
|
|
|
479
479
|
makeFromComponent(component, sort = false) {
|
|
480
480
|
const qualifiers = {};
|
|
481
481
|
let subpath;
|
|
482
|
-
const extRefs =
|
|
483
|
-
|
|
482
|
+
const extRefs = sort
|
|
483
|
+
? component.externalReferences.sorted()
|
|
484
|
+
: component.externalReferences;
|
|
485
|
+
for (const extRef of extRefs) {
|
|
486
|
+
const url = extRef.url.toString();
|
|
487
|
+
if (url.length <= 0) {
|
|
488
|
+
continue;
|
|
489
|
+
}
|
|
484
490
|
switch (extRef.type) {
|
|
485
491
|
case enums_1.ExternalReferenceType.VCS:
|
|
486
|
-
[qualifiers.vcs_url, subpath] =
|
|
492
|
+
[qualifiers.vcs_url, subpath] = url.split('#', 2);
|
|
487
493
|
break;
|
|
488
494
|
case enums_1.ExternalReferenceType.Distribution:
|
|
489
|
-
qualifiers.download_url =
|
|
495
|
+
qualifiers.download_url = url;
|
|
490
496
|
break;
|
|
491
497
|
}
|
|
492
498
|
}
|