@cyclonedx/cyclonedx-library 9.2.0 → 9.4.0

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.
Files changed (166) hide show
  1. package/dist.d/builders/index.node.d.ts +9 -1
  2. package/dist.d/builders/index.node.d.ts.map +1 -1
  3. package/dist.d/contrib/bom/index.d.ts +20 -0
  4. package/dist.d/contrib/bom/index.d.ts.map +1 -0
  5. package/dist.d/{utils/bomUtility.d.ts → contrib/bom/utils.d.ts} +1 -1
  6. package/dist.d/contrib/bom/utils.d.ts.map +1 -0
  7. package/dist.d/contrib/fromNodePackageJson/_helpers/gitUrl.d.ts.map +1 -0
  8. package/dist.d/contrib/fromNodePackageJson/_helpers/packageJson.d.ts.map +1 -0
  9. package/dist.d/{builders/fromNodePackageJson.node.d.ts → contrib/fromNodePackageJson/builders.d.ts} +18 -9
  10. package/dist.d/contrib/fromNodePackageJson/builders.d.ts.map +1 -0
  11. package/dist.d/{factories/fromNodePackageJson.node.d.ts → contrib/fromNodePackageJson/factories.d.ts} +5 -5
  12. package/dist.d/contrib/fromNodePackageJson/factories.d.ts.map +1 -0
  13. package/dist.d/contrib/fromNodePackageJson/index.node.d.ts +31 -0
  14. package/dist.d/contrib/fromNodePackageJson/index.node.d.ts.map +1 -0
  15. package/dist.d/{types/nodePackageJson.d.ts → contrib/fromNodePackageJson/types.d.ts} +1 -1
  16. package/dist.d/contrib/fromNodePackageJson/types.d.ts.map +1 -0
  17. package/dist.d/{utils/npmjsUtility.node.d.ts → contrib/fromNodePackageJson/utils.d.ts} +2 -2
  18. package/dist.d/contrib/fromNodePackageJson/utils.d.ts.map +1 -0
  19. package/dist.d/contrib/index.common.d.ts +24 -0
  20. package/dist.d/contrib/index.common.d.ts.map +1 -0
  21. package/dist.d/contrib/index.node.d.ts +25 -0
  22. package/dist.d/contrib/index.node.d.ts.map +1 -0
  23. package/dist.d/contrib/index.web.d.ts +24 -0
  24. package/dist.d/contrib/index.web.d.ts.map +1 -0
  25. package/dist.d/contrib/license/_helpers/mime.node.d.ts.map +1 -0
  26. package/dist.d/{factories/license.d.ts → contrib/license/factories.d.ts} +3 -3
  27. package/dist.d/contrib/license/factories.d.ts.map +1 -0
  28. package/dist.d/contrib/license/index.common.d.ts +20 -0
  29. package/dist.d/contrib/license/index.common.d.ts.map +1 -0
  30. package/dist.d/contrib/license/index.node.d.ts +21 -0
  31. package/dist.d/contrib/license/index.node.d.ts.map +1 -0
  32. package/dist.d/contrib/license/index.web.d.ts +20 -0
  33. package/dist.d/contrib/license/index.web.d.ts.map +1 -0
  34. package/dist.d/{utils/licenseUtility.node.d.ts → contrib/license/utils.node.d.ts} +2 -2
  35. package/dist.d/contrib/license/utils.node.d.ts.map +1 -0
  36. package/dist.d/{factories/packageUrl.d.ts → contrib/packageUrl/factories.d.ts} +2 -2
  37. package/dist.d/contrib/packageUrl/factories.d.ts.map +1 -0
  38. package/dist.d/contrib/packageUrl/index.d.ts +20 -0
  39. package/dist.d/contrib/packageUrl/index.d.ts.map +1 -0
  40. package/dist.d/factories/index.common.d.ts +18 -2
  41. package/dist.d/factories/index.common.d.ts.map +1 -1
  42. package/dist.d/factories/index.node.d.ts +9 -1
  43. package/dist.d/factories/index.node.d.ts.map +1 -1
  44. package/dist.d/index.node.d.ts +4 -0
  45. package/dist.d/index.node.d.ts.map +1 -1
  46. package/dist.d/index.web.d.ts +3 -0
  47. package/dist.d/index.web.d.ts.map +1 -1
  48. package/dist.d/types/index.d.ts +25 -1
  49. package/dist.d/types/index.d.ts.map +1 -1
  50. package/dist.d/utils/index.common.d.ts +9 -1
  51. package/dist.d/utils/index.common.d.ts.map +1 -1
  52. package/dist.d/utils/index.node.d.ts +18 -2
  53. package/dist.d/utils/index.node.d.ts.map +1 -1
  54. package/dist.node/builders/index.node.js +2 -1
  55. package/dist.node/builders/index.node.js.map +1 -1
  56. package/dist.node/contrib/bom/index.js +56 -0
  57. package/dist.node/contrib/bom/index.js.map +1 -0
  58. package/dist.node/{utils/bomUtility.js → contrib/bom/utils.js} +1 -1
  59. package/dist.node/contrib/bom/utils.js.map +1 -0
  60. package/dist.node/contrib/fromNodePackageJson/_helpers/gitUrl.js.map +1 -0
  61. package/dist.node/contrib/fromNodePackageJson/_helpers/packageJson.js.map +1 -0
  62. package/dist.node/{builders/fromNodePackageJson.node.js → contrib/fromNodePackageJson/builders.js} +7 -7
  63. package/dist.node/contrib/fromNodePackageJson/builders.js.map +1 -0
  64. package/dist.node/{factories/fromNodePackageJson.node.js → contrib/fromNodePackageJson/factories.js} +17 -17
  65. package/dist.node/contrib/fromNodePackageJson/factories.js.map +1 -0
  66. package/dist.node/contrib/fromNodePackageJson/index.node.js +59 -0
  67. package/dist.node/contrib/fromNodePackageJson/index.node.js.map +1 -0
  68. package/dist.node/{types/nodePackageJson.js → contrib/fromNodePackageJson/types.js} +1 -1
  69. package/dist.node/contrib/fromNodePackageJson/types.js.map +1 -0
  70. package/dist.node/{utils/npmjsUtility.node.js → contrib/fromNodePackageJson/utils.js} +2 -2
  71. package/dist.node/contrib/fromNodePackageJson/utils.js.map +1 -0
  72. package/dist.node/contrib/index.common.js +57 -0
  73. package/dist.node/contrib/index.common.js.map +1 -0
  74. package/dist.node/contrib/index.node.js +61 -0
  75. package/dist.node/contrib/index.node.js.map +1 -0
  76. package/dist.node/contrib/license/_helpers/mime.node.js.map +1 -0
  77. package/dist.node/{factories/license.js → contrib/license/factories.js} +3 -3
  78. package/dist.node/contrib/license/factories.js.map +1 -0
  79. package/dist.node/contrib/license/index.common.js +56 -0
  80. package/dist.node/contrib/license/index.common.js.map +1 -0
  81. package/dist.node/contrib/license/index.node.js +60 -0
  82. package/dist.node/contrib/license/index.node.js.map +1 -0
  83. package/dist.node/{utils/licenseUtility.node.js → contrib/license/utils.node.js} +4 -4
  84. package/dist.node/contrib/license/utils.node.js.map +1 -0
  85. package/dist.node/{factories/packageUrl.js → contrib/packageUrl/factories.js} +2 -2
  86. package/dist.node/contrib/packageUrl/factories.js.map +1 -0
  87. package/dist.node/contrib/packageUrl/index.js +56 -0
  88. package/dist.node/contrib/packageUrl/index.js.map +1 -0
  89. package/dist.node/factories/index.common.js +5 -16
  90. package/dist.node/factories/index.common.js.map +1 -1
  91. package/dist.node/factories/index.node.js +5 -4
  92. package/dist.node/factories/index.node.js.map +1 -1
  93. package/dist.node/index.node.js +2 -1
  94. package/dist.node/index.node.js.map +1 -1
  95. package/dist.node/types/index.js +4 -1
  96. package/dist.node/types/index.js.map +1 -1
  97. package/dist.node/utils/index.common.js +2 -1
  98. package/dist.node/utils/index.common.js.map +1 -1
  99. package/dist.node/utils/index.node.js +8 -6
  100. package/dist.node/utils/index.node.js.map +1 -1
  101. package/dist.web/lib.dev.js +622 -253
  102. package/dist.web/lib.dev.js.map +1 -1
  103. package/dist.web/lib.js +1 -1
  104. package/dist.web/lib.js.map +1 -1
  105. package/package.json +23 -3
  106. package/res/schema/README.md +3 -1
  107. package/src/builders/index.node.ts +15 -1
  108. package/src/contrib/README.md +20 -0
  109. package/src/contrib/bom/index.ts +20 -0
  110. package/src/contrib/fromNodePackageJson/_helpers/README.md +6 -0
  111. package/src/{builders/fromNodePackageJson.node.ts → contrib/fromNodePackageJson/builders.ts} +17 -16
  112. package/src/{factories/fromNodePackageJson.node.ts → contrib/fromNodePackageJson/factories.ts} +15 -15
  113. package/src/contrib/fromNodePackageJson/index.node.ts +34 -0
  114. package/src/{utils/npmjsUtility.node.ts → contrib/fromNodePackageJson/utils.ts} +1 -1
  115. package/src/contrib/index.common.ts +25 -0
  116. package/src/contrib/index.node.ts +31 -0
  117. package/src/contrib/index.web.ts +30 -0
  118. package/src/contrib/license/_helpers/README.md +6 -0
  119. package/src/{factories/license.ts → contrib/license/factories.ts} +3 -3
  120. package/src/contrib/license/index.common.ts +22 -0
  121. package/src/contrib/license/index.node.ts +28 -0
  122. package/src/contrib/license/index.web.ts +28 -0
  123. package/src/{utils/licenseUtility.node.ts → contrib/license/utils.node.ts} +3 -3
  124. package/src/{factories/packageUrl.ts → contrib/packageUrl/factories.ts} +2 -2
  125. package/src/contrib/packageUrl/index.ts +20 -0
  126. package/src/factories/index.common.ts +24 -3
  127. package/src/factories/index.node.ts +14 -1
  128. package/src/index.common.ts +1 -0
  129. package/src/index.node.ts +7 -0
  130. package/src/index.web.ts +6 -0
  131. package/src/types/index.ts +37 -2
  132. package/src/utils/index.common.ts +15 -1
  133. package/src/utils/index.node.ts +25 -2
  134. package/dist.d/_helpers/gitUrl.d.ts.map +0 -1
  135. package/dist.d/_helpers/mime.node.d.ts.map +0 -1
  136. package/dist.d/_helpers/packageJson.d.ts.map +0 -1
  137. package/dist.d/builders/fromNodePackageJson.node.d.ts.map +0 -1
  138. package/dist.d/factories/fromNodePackageJson.node.d.ts.map +0 -1
  139. package/dist.d/factories/license.d.ts.map +0 -1
  140. package/dist.d/factories/packageUrl.d.ts.map +0 -1
  141. package/dist.d/types/nodePackageJson.d.ts.map +0 -1
  142. package/dist.d/utils/bomUtility.d.ts.map +0 -1
  143. package/dist.d/utils/licenseUtility.node.d.ts.map +0 -1
  144. package/dist.d/utils/npmjsUtility.node.d.ts.map +0 -1
  145. package/dist.node/_helpers/gitUrl.js.map +0 -1
  146. package/dist.node/_helpers/mime.node.js.map +0 -1
  147. package/dist.node/_helpers/packageJson.js.map +0 -1
  148. package/dist.node/builders/fromNodePackageJson.node.js.map +0 -1
  149. package/dist.node/factories/fromNodePackageJson.node.js.map +0 -1
  150. package/dist.node/factories/license.js.map +0 -1
  151. package/dist.node/factories/packageUrl.js.map +0 -1
  152. package/dist.node/types/nodePackageJson.js.map +0 -1
  153. package/dist.node/utils/bomUtility.js.map +0 -1
  154. package/dist.node/utils/licenseUtility.node.js.map +0 -1
  155. package/dist.node/utils/npmjsUtility.node.js.map +0 -1
  156. /package/dist.d/{_helpers → contrib/fromNodePackageJson/_helpers}/gitUrl.d.ts +0 -0
  157. /package/dist.d/{_helpers → contrib/fromNodePackageJson/_helpers}/packageJson.d.ts +0 -0
  158. /package/dist.d/{_helpers → contrib/license/_helpers}/mime.node.d.ts +0 -0
  159. /package/dist.node/{_helpers → contrib/fromNodePackageJson/_helpers}/gitUrl.js +0 -0
  160. /package/dist.node/{_helpers → contrib/fromNodePackageJson/_helpers}/packageJson.js +0 -0
  161. /package/dist.node/{_helpers → contrib/license/_helpers}/mime.node.js +0 -0
  162. /package/src/{utils/bomUtility.ts → contrib/bom/utils.ts} +0 -0
  163. /package/src/{_helpers → contrib/fromNodePackageJson/_helpers}/gitUrl.ts +0 -0
  164. /package/src/{_helpers → contrib/fromNodePackageJson/_helpers}/packageJson.ts +0 -0
  165. /package/src/{types/nodePackageJson.ts → contrib/fromNodePackageJson/types.ts} +0 -0
  166. /package/src/{_helpers → contrib/license/_helpers}/mime.node.ts +0 -0
@@ -287,6 +287,614 @@ class OptPlugError extends Error {
287
287
  exports.OptPlugError = OptPlugError;
288
288
 
289
289
 
290
+ /***/ }),
291
+
292
+ /***/ "./src/contrib/bom/index.ts":
293
+ /*!**********************************!*\
294
+ !*** ./src/contrib/bom/index.ts ***!
295
+ \**********************************/
296
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
297
+
298
+
299
+ /*!
300
+ This file is part of CycloneDX JavaScript Library.
301
+
302
+ Licensed under the Apache License, Version 2.0 (the "License");
303
+ you may not use this file except in compliance with the License.
304
+ You may obtain a copy of the License at
305
+
306
+ http://www.apache.org/licenses/LICENSE-2.0
307
+
308
+ Unless required by applicable law or agreed to in writing, software
309
+ distributed under the License is distributed on an "AS IS" BASIS,
310
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
311
+ See the License for the specific language governing permissions and
312
+ limitations under the License.
313
+
314
+ SPDX-License-Identifier: Apache-2.0
315
+ Copyright (c) OWASP Foundation. All Rights Reserved.
316
+ */
317
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
318
+ if (k2 === undefined) k2 = k;
319
+ var desc = Object.getOwnPropertyDescriptor(m, k);
320
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
321
+ desc = { enumerable: true, get: function() { return m[k]; } };
322
+ }
323
+ Object.defineProperty(o, k2, desc);
324
+ }) : (function(o, m, k, k2) {
325
+ if (k2 === undefined) k2 = k;
326
+ o[k2] = m[k];
327
+ }));
328
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
329
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
330
+ }) : function(o, v) {
331
+ o["default"] = v;
332
+ });
333
+ var __importStar = (this && this.__importStar) || (function () {
334
+ var ownKeys = function(o) {
335
+ ownKeys = Object.getOwnPropertyNames || function (o) {
336
+ var ar = [];
337
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
338
+ return ar;
339
+ };
340
+ return ownKeys(o);
341
+ };
342
+ return function (mod) {
343
+ if (mod && mod.__esModule) return mod;
344
+ var result = {};
345
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
346
+ __setModuleDefault(result, mod);
347
+ return result;
348
+ };
349
+ })();
350
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
351
+ exports.Utils = void 0;
352
+ exports.Utils = __importStar(__webpack_require__(/*! ./utils */ "./src/contrib/bom/utils.ts"));
353
+
354
+
355
+ /***/ }),
356
+
357
+ /***/ "./src/contrib/bom/utils.ts":
358
+ /*!**********************************!*\
359
+ !*** ./src/contrib/bom/utils.ts ***!
360
+ \**********************************/
361
+ /***/ ((__unused_webpack_module, exports) => {
362
+
363
+
364
+ /*!
365
+ This file is part of CycloneDX JavaScript Library.
366
+
367
+ Licensed under the Apache License, Version 2.0 (the "License");
368
+ you may not use this file except in compliance with the License.
369
+ You may obtain a copy of the License at
370
+
371
+ http://www.apache.org/licenses/LICENSE-2.0
372
+
373
+ Unless required by applicable law or agreed to in writing, software
374
+ distributed under the License is distributed on an "AS IS" BASIS,
375
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
376
+ See the License for the specific language governing permissions and
377
+ limitations under the License.
378
+
379
+ SPDX-License-Identifier: Apache-2.0
380
+ Copyright (c) OWASP Foundation. All Rights Reserved.
381
+ */
382
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
383
+ exports.randomSerialNumber = randomSerialNumber;
384
+ function randomSerialNumber() {
385
+ const b = [
386
+ Math.round(Math.random() * 0xFFFF),
387
+ Math.round(Math.random() * 0xFFFF),
388
+ Math.round(Math.random() * 0xFFFF),
389
+ Math.round(Math.random() * 0x0FFF) | 0x4000,
390
+ Math.round(Math.random() * 0x3FFF) | 0x8000,
391
+ Math.round(Math.random() * 0xFFFF),
392
+ Math.round(Math.random() * 0xFFFF),
393
+ Math.round(Math.random() * 0xFFFF)
394
+ ].map(n => n.toString(16).padStart(4, '0'));
395
+ return `urn:uuid:${b[0]}${b[1]}-${b[2]}-${b[3]}-${b[4]}-${b[5]}${b[6]}${b[7]}`;
396
+ }
397
+
398
+
399
+ /***/ }),
400
+
401
+ /***/ "./src/contrib/fromNodePackageJson/types.ts":
402
+ /*!**************************************************!*\
403
+ !*** ./src/contrib/fromNodePackageJson/types.ts ***!
404
+ \**************************************************/
405
+ /***/ ((__unused_webpack_module, exports) => {
406
+
407
+
408
+ /*!
409
+ This file is part of CycloneDX JavaScript Library.
410
+
411
+ Licensed under the Apache License, Version 2.0 (the "License");
412
+ you may not use this file except in compliance with the License.
413
+ You may obtain a copy of the License at
414
+
415
+ http://www.apache.org/licenses/LICENSE-2.0
416
+
417
+ Unless required by applicable law or agreed to in writing, software
418
+ distributed under the License is distributed on an "AS IS" BASIS,
419
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
420
+ See the License for the specific language governing permissions and
421
+ limitations under the License.
422
+
423
+ SPDX-License-Identifier: Apache-2.0
424
+ Copyright (c) OWASP Foundation. All Rights Reserved.
425
+ */
426
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
427
+ exports.isNodePackageJson = isNodePackageJson;
428
+ exports.assertNodePackageJson = assertNodePackageJson;
429
+ function isNodePackageJson(value) {
430
+ throw new Error('Not implemented');
431
+ }
432
+ function assertNodePackageJson(value) {
433
+ throw new Error('Not implemented');
434
+ }
435
+
436
+
437
+ /***/ }),
438
+
439
+ /***/ "./src/contrib/index.common.ts":
440
+ /*!*************************************!*\
441
+ !*** ./src/contrib/index.common.ts ***!
442
+ \*************************************/
443
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
444
+
445
+
446
+ /*!
447
+ This file is part of CycloneDX JavaScript Library.
448
+
449
+ Licensed under the Apache License, Version 2.0 (the "License");
450
+ you may not use this file except in compliance with the License.
451
+ You may obtain a copy of the License at
452
+
453
+ http://www.apache.org/licenses/LICENSE-2.0
454
+
455
+ Unless required by applicable law or agreed to in writing, software
456
+ distributed under the License is distributed on an "AS IS" BASIS,
457
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
458
+ See the License for the specific language governing permissions and
459
+ limitations under the License.
460
+
461
+ SPDX-License-Identifier: Apache-2.0
462
+ Copyright (c) OWASP Foundation. All Rights Reserved.
463
+ */
464
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
465
+ if (k2 === undefined) k2 = k;
466
+ var desc = Object.getOwnPropertyDescriptor(m, k);
467
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
468
+ desc = { enumerable: true, get: function() { return m[k]; } };
469
+ }
470
+ Object.defineProperty(o, k2, desc);
471
+ }) : (function(o, m, k, k2) {
472
+ if (k2 === undefined) k2 = k;
473
+ o[k2] = m[k];
474
+ }));
475
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
476
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
477
+ }) : function(o, v) {
478
+ o["default"] = v;
479
+ });
480
+ var __importStar = (this && this.__importStar) || (function () {
481
+ var ownKeys = function(o) {
482
+ ownKeys = Object.getOwnPropertyNames || function (o) {
483
+ var ar = [];
484
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
485
+ return ar;
486
+ };
487
+ return ownKeys(o);
488
+ };
489
+ return function (mod) {
490
+ if (mod && mod.__esModule) return mod;
491
+ var result = {};
492
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
493
+ __setModuleDefault(result, mod);
494
+ return result;
495
+ };
496
+ })();
497
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
498
+ exports.PackageUrl = exports.Bom = void 0;
499
+ exports.Bom = __importStar(__webpack_require__(/*! ./bom */ "./src/contrib/bom/index.ts"));
500
+ exports.PackageUrl = __importStar(__webpack_require__(/*! ./packageUrl */ "./src/contrib/packageUrl/index.ts"));
501
+
502
+
503
+ /***/ }),
504
+
505
+ /***/ "./src/contrib/index.web.ts":
506
+ /*!**********************************!*\
507
+ !*** ./src/contrib/index.web.ts ***!
508
+ \**********************************/
509
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
510
+
511
+
512
+ /*!
513
+ This file is part of CycloneDX JavaScript Library.
514
+
515
+ Licensed under the Apache License, Version 2.0 (the "License");
516
+ you may not use this file except in compliance with the License.
517
+ You may obtain a copy of the License at
518
+
519
+ http://www.apache.org/licenses/LICENSE-2.0
520
+
521
+ Unless required by applicable law or agreed to in writing, software
522
+ distributed under the License is distributed on an "AS IS" BASIS,
523
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
524
+ See the License for the specific language governing permissions and
525
+ limitations under the License.
526
+
527
+ SPDX-License-Identifier: Apache-2.0
528
+ Copyright (c) OWASP Foundation. All Rights Reserved.
529
+ */
530
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
531
+ if (k2 === undefined) k2 = k;
532
+ var desc = Object.getOwnPropertyDescriptor(m, k);
533
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
534
+ desc = { enumerable: true, get: function() { return m[k]; } };
535
+ }
536
+ Object.defineProperty(o, k2, desc);
537
+ }) : (function(o, m, k, k2) {
538
+ if (k2 === undefined) k2 = k;
539
+ o[k2] = m[k];
540
+ }));
541
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
542
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
543
+ }) : function(o, v) {
544
+ o["default"] = v;
545
+ });
546
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
547
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
548
+ };
549
+ var __importStar = (this && this.__importStar) || (function () {
550
+ var ownKeys = function(o) {
551
+ ownKeys = Object.getOwnPropertyNames || function (o) {
552
+ var ar = [];
553
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
554
+ return ar;
555
+ };
556
+ return ownKeys(o);
557
+ };
558
+ return function (mod) {
559
+ if (mod && mod.__esModule) return mod;
560
+ var result = {};
561
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
562
+ __setModuleDefault(result, mod);
563
+ return result;
564
+ };
565
+ })();
566
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
567
+ exports.License = void 0;
568
+ __exportStar(__webpack_require__(/*! ./index.common */ "./src/contrib/index.common.ts"), exports);
569
+ exports.License = __importStar(__webpack_require__(/*! ./license/index.web */ "./src/contrib/license/index.web.ts"));
570
+
571
+
572
+ /***/ }),
573
+
574
+ /***/ "./src/contrib/license/factories.ts":
575
+ /*!******************************************!*\
576
+ !*** ./src/contrib/license/factories.ts ***!
577
+ \******************************************/
578
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
579
+
580
+
581
+ /*!
582
+ This file is part of CycloneDX JavaScript Library.
583
+
584
+ Licensed under the Apache License, Version 2.0 (the "License");
585
+ you may not use this file except in compliance with the License.
586
+ You may obtain a copy of the License at
587
+
588
+ http://www.apache.org/licenses/LICENSE-2.0
589
+
590
+ Unless required by applicable law or agreed to in writing, software
591
+ distributed under the License is distributed on an "AS IS" BASIS,
592
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
593
+ See the License for the specific language governing permissions and
594
+ limitations under the License.
595
+
596
+ SPDX-License-Identifier: Apache-2.0
597
+ Copyright (c) OWASP Foundation. All Rights Reserved.
598
+ */
599
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
600
+ exports.LicenseFactory = void 0;
601
+ const license_1 = __webpack_require__(/*! ../../models/license */ "./src/models/license.ts");
602
+ const spdx_1 = __webpack_require__(/*! ../../spdx */ "./src/spdx.ts");
603
+ class LicenseFactory {
604
+ makeFromString(value) {
605
+ try {
606
+ return this.makeSpdxLicense(value);
607
+ }
608
+ catch {
609
+ }
610
+ try {
611
+ return this.makeExpression(value);
612
+ }
613
+ catch {
614
+ }
615
+ return this.makeNamedLicense(value);
616
+ }
617
+ makeExpression(value) {
618
+ const expression = String(value);
619
+ if ((0, spdx_1.isValidSpdxLicenseExpression)(expression)) {
620
+ return new license_1.LicenseExpression(expression);
621
+ }
622
+ throw new RangeError('Invalid SPDX license expression');
623
+ }
624
+ makeDisjunctive(value) {
625
+ try {
626
+ return this.makeSpdxLicense(value);
627
+ }
628
+ catch {
629
+ return this.makeNamedLicense(value);
630
+ }
631
+ }
632
+ makeSpdxLicense(value) {
633
+ const fixed = (0, spdx_1.fixupSpdxId)(String(value));
634
+ if (undefined === fixed) {
635
+ throw new RangeError('Unsupported SPDX license ID');
636
+ }
637
+ return new license_1.SpdxLicense(fixed);
638
+ }
639
+ makeNamedLicense(value) {
640
+ return new license_1.NamedLicense(String(value));
641
+ }
642
+ }
643
+ exports.LicenseFactory = LicenseFactory;
644
+
645
+
646
+ /***/ }),
647
+
648
+ /***/ "./src/contrib/license/index.common.ts":
649
+ /*!*********************************************!*\
650
+ !*** ./src/contrib/license/index.common.ts ***!
651
+ \*********************************************/
652
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
653
+
654
+
655
+ /*!
656
+ This file is part of CycloneDX JavaScript Library.
657
+
658
+ Licensed under the Apache License, Version 2.0 (the "License");
659
+ you may not use this file except in compliance with the License.
660
+ You may obtain a copy of the License at
661
+
662
+ http://www.apache.org/licenses/LICENSE-2.0
663
+
664
+ Unless required by applicable law or agreed to in writing, software
665
+ distributed under the License is distributed on an "AS IS" BASIS,
666
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
667
+ See the License for the specific language governing permissions and
668
+ limitations under the License.
669
+
670
+ SPDX-License-Identifier: Apache-2.0
671
+ Copyright (c) OWASP Foundation. All Rights Reserved.
672
+ */
673
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
674
+ if (k2 === undefined) k2 = k;
675
+ var desc = Object.getOwnPropertyDescriptor(m, k);
676
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
677
+ desc = { enumerable: true, get: function() { return m[k]; } };
678
+ }
679
+ Object.defineProperty(o, k2, desc);
680
+ }) : (function(o, m, k, k2) {
681
+ if (k2 === undefined) k2 = k;
682
+ o[k2] = m[k];
683
+ }));
684
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
685
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
686
+ }) : function(o, v) {
687
+ o["default"] = v;
688
+ });
689
+ var __importStar = (this && this.__importStar) || (function () {
690
+ var ownKeys = function(o) {
691
+ ownKeys = Object.getOwnPropertyNames || function (o) {
692
+ var ar = [];
693
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
694
+ return ar;
695
+ };
696
+ return ownKeys(o);
697
+ };
698
+ return function (mod) {
699
+ if (mod && mod.__esModule) return mod;
700
+ var result = {};
701
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
702
+ __setModuleDefault(result, mod);
703
+ return result;
704
+ };
705
+ })();
706
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
707
+ exports.Factories = void 0;
708
+ exports.Factories = __importStar(__webpack_require__(/*! ./factories */ "./src/contrib/license/factories.ts"));
709
+
710
+
711
+ /***/ }),
712
+
713
+ /***/ "./src/contrib/license/index.web.ts":
714
+ /*!******************************************!*\
715
+ !*** ./src/contrib/license/index.web.ts ***!
716
+ \******************************************/
717
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
718
+
719
+
720
+ /*!
721
+ This file is part of CycloneDX JavaScript Library.
722
+
723
+ Licensed under the Apache License, Version 2.0 (the "License");
724
+ you may not use this file except in compliance with the License.
725
+ You may obtain a copy of the License at
726
+
727
+ http://www.apache.org/licenses/LICENSE-2.0
728
+
729
+ Unless required by applicable law or agreed to in writing, software
730
+ distributed under the License is distributed on an "AS IS" BASIS,
731
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
732
+ See the License for the specific language governing permissions and
733
+ limitations under the License.
734
+
735
+ SPDX-License-Identifier: Apache-2.0
736
+ Copyright (c) OWASP Foundation. All Rights Reserved.
737
+ */
738
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
739
+ if (k2 === undefined) k2 = k;
740
+ var desc = Object.getOwnPropertyDescriptor(m, k);
741
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
742
+ desc = { enumerable: true, get: function() { return m[k]; } };
743
+ }
744
+ Object.defineProperty(o, k2, desc);
745
+ }) : (function(o, m, k, k2) {
746
+ if (k2 === undefined) k2 = k;
747
+ o[k2] = m[k];
748
+ }));
749
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
750
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
751
+ };
752
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
753
+ __exportStar(__webpack_require__(/*! ./index.common */ "./src/contrib/license/index.common.ts"), exports);
754
+
755
+
756
+ /***/ }),
757
+
758
+ /***/ "./src/contrib/packageUrl/factories.ts":
759
+ /*!*********************************************!*\
760
+ !*** ./src/contrib/packageUrl/factories.ts ***!
761
+ \*********************************************/
762
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
763
+
764
+
765
+ /*!
766
+ This file is part of CycloneDX JavaScript Library.
767
+
768
+ Licensed under the Apache License, Version 2.0 (the "License");
769
+ you may not use this file except in compliance with the License.
770
+ You may obtain a copy of the License at
771
+
772
+ http://www.apache.org/licenses/LICENSE-2.0
773
+
774
+ Unless required by applicable law or agreed to in writing, software
775
+ distributed under the License is distributed on an "AS IS" BASIS,
776
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
777
+ See the License for the specific language governing permissions and
778
+ limitations under the License.
779
+
780
+ SPDX-License-Identifier: Apache-2.0
781
+ Copyright (c) OWASP Foundation. All Rights Reserved.
782
+ */
783
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
784
+ exports.PackageUrlFactory = void 0;
785
+ const packageurl_js_1 = __webpack_require__(/*! packageurl-js */ "packageurl-js");
786
+ const externalReferenceType_1 = __webpack_require__(/*! ../../enums/externalReferenceType */ "./src/enums/externalReferenceType.ts");
787
+ class PackageUrlFactory {
788
+ #type;
789
+ constructor(type) {
790
+ this.#type = type;
791
+ }
792
+ get type() {
793
+ return this.#type;
794
+ }
795
+ makeFromComponent(component, sort = false) {
796
+ const qualifiers = {};
797
+ qualifiers.__proto__ = null;
798
+ let subpath = undefined;
799
+ const extRefs = sort
800
+ ? component.externalReferences.sorted()
801
+ : component.externalReferences;
802
+ for (const extRef of extRefs) {
803
+ const url = extRef.url.toString();
804
+ if (url.length <= 0) {
805
+ continue;
806
+ }
807
+ switch (extRef.type) {
808
+ case externalReferenceType_1.ExternalReferenceType.VCS:
809
+ [qualifiers[packageurl_js_1.PurlQualifierNames.VcsUrl], subpath] = url.split('#', 2);
810
+ break;
811
+ case externalReferenceType_1.ExternalReferenceType.Distribution:
812
+ qualifiers[packageurl_js_1.PurlQualifierNames.DownloadUrl] = url;
813
+ break;
814
+ }
815
+ }
816
+ const hashes = component.hashes;
817
+ if (hashes.size > 0) {
818
+ qualifiers[packageurl_js_1.PurlQualifierNames.Checksum] = Array.from(sort
819
+ ? hashes.sorted()
820
+ : hashes, ([hashAlgo, hashCont]) => `${hashAlgo.toLowerCase()}:${hashCont.toLowerCase()}`).join(',');
821
+ }
822
+ try {
823
+ return new packageurl_js_1.PackageURL(this.#type, component.group, component.name, component.version, qualifiers, subpath);
824
+ }
825
+ catch {
826
+ return undefined;
827
+ }
828
+ }
829
+ }
830
+ exports.PackageUrlFactory = PackageUrlFactory;
831
+
832
+
833
+ /***/ }),
834
+
835
+ /***/ "./src/contrib/packageUrl/index.ts":
836
+ /*!*****************************************!*\
837
+ !*** ./src/contrib/packageUrl/index.ts ***!
838
+ \*****************************************/
839
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
840
+
841
+
842
+ /*!
843
+ This file is part of CycloneDX JavaScript Library.
844
+
845
+ Licensed under the Apache License, Version 2.0 (the "License");
846
+ you may not use this file except in compliance with the License.
847
+ You may obtain a copy of the License at
848
+
849
+ http://www.apache.org/licenses/LICENSE-2.0
850
+
851
+ Unless required by applicable law or agreed to in writing, software
852
+ distributed under the License is distributed on an "AS IS" BASIS,
853
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
854
+ See the License for the specific language governing permissions and
855
+ limitations under the License.
856
+
857
+ SPDX-License-Identifier: Apache-2.0
858
+ Copyright (c) OWASP Foundation. All Rights Reserved.
859
+ */
860
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
861
+ if (k2 === undefined) k2 = k;
862
+ var desc = Object.getOwnPropertyDescriptor(m, k);
863
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
864
+ desc = { enumerable: true, get: function() { return m[k]; } };
865
+ }
866
+ Object.defineProperty(o, k2, desc);
867
+ }) : (function(o, m, k, k2) {
868
+ if (k2 === undefined) k2 = k;
869
+ o[k2] = m[k];
870
+ }));
871
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
872
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
873
+ }) : function(o, v) {
874
+ o["default"] = v;
875
+ });
876
+ var __importStar = (this && this.__importStar) || (function () {
877
+ var ownKeys = function(o) {
878
+ ownKeys = Object.getOwnPropertyNames || function (o) {
879
+ var ar = [];
880
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
881
+ return ar;
882
+ };
883
+ return ownKeys(o);
884
+ };
885
+ return function (mod) {
886
+ if (mod && mod.__esModule) return mod;
887
+ var result = {};
888
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
889
+ __setModuleDefault(result, mod);
890
+ return result;
891
+ };
892
+ })();
893
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
894
+ exports.Factories = void 0;
895
+ exports.Factories = __importStar(__webpack_require__(/*! ./factories */ "./src/contrib/packageUrl/factories.ts"));
896
+
897
+
290
898
  /***/ }),
291
899
 
292
900
  /***/ "./src/enums/attachmentEncoding.ts":
@@ -988,7 +1596,7 @@ var Severity;
988
1596
  /*!***************************************!*\
989
1597
  !*** ./src/factories/index.common.ts ***!
990
1598
  \***************************************/
991
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
1599
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
992
1600
 
993
1601
 
994
1602
  /*!
@@ -1009,23 +1617,12 @@ limitations under the License.
1009
1617
  SPDX-License-Identifier: Apache-2.0
1010
1618
  Copyright (c) OWASP Foundation. All Rights Reserved.
1011
1619
  */
1012
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
1013
- if (k2 === undefined) k2 = k;
1014
- var desc = Object.getOwnPropertyDescriptor(m, k);
1015
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
1016
- desc = { enumerable: true, get: function() { return m[k]; } };
1017
- }
1018
- Object.defineProperty(o, k2, desc);
1019
- }) : (function(o, m, k, k2) {
1020
- if (k2 === undefined) k2 = k;
1021
- o[k2] = m[k];
1022
- }));
1023
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
1024
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
1025
- };
1026
1620
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1027
- __exportStar(__webpack_require__(/*! ./license */ "./src/factories/license.ts"), exports);
1028
- __exportStar(__webpack_require__(/*! ./packageUrl */ "./src/factories/packageUrl.ts"), exports);
1621
+ exports.PackageUrlFactory = exports.LicenseFactory = void 0;
1622
+ const factories_1 = __webpack_require__(/*! ../contrib/license/factories */ "./src/contrib/license/factories.ts");
1623
+ const factories_2 = __webpack_require__(/*! ../contrib/packageUrl/factories */ "./src/contrib/packageUrl/factories.ts");
1624
+ exports.LicenseFactory = factories_1.LicenseFactory;
1625
+ exports.PackageUrlFactory = factories_2.PackageUrlFactory;
1029
1626
 
1030
1627
 
1031
1628
  /***/ }),
@@ -1073,157 +1670,6 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
1073
1670
  __exportStar(__webpack_require__(/*! ./index.common */ "./src/factories/index.common.ts"), exports);
1074
1671
 
1075
1672
 
1076
- /***/ }),
1077
-
1078
- /***/ "./src/factories/license.ts":
1079
- /*!**********************************!*\
1080
- !*** ./src/factories/license.ts ***!
1081
- \**********************************/
1082
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1083
-
1084
-
1085
- /*!
1086
- This file is part of CycloneDX JavaScript Library.
1087
-
1088
- Licensed under the Apache License, Version 2.0 (the "License");
1089
- you may not use this file except in compliance with the License.
1090
- You may obtain a copy of the License at
1091
-
1092
- http://www.apache.org/licenses/LICENSE-2.0
1093
-
1094
- Unless required by applicable law or agreed to in writing, software
1095
- distributed under the License is distributed on an "AS IS" BASIS,
1096
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1097
- See the License for the specific language governing permissions and
1098
- limitations under the License.
1099
-
1100
- SPDX-License-Identifier: Apache-2.0
1101
- Copyright (c) OWASP Foundation. All Rights Reserved.
1102
- */
1103
- Object.defineProperty(exports, "__esModule", ({ value: true }));
1104
- exports.LicenseFactory = void 0;
1105
- const license_1 = __webpack_require__(/*! ../models/license */ "./src/models/license.ts");
1106
- const spdx_1 = __webpack_require__(/*! ../spdx */ "./src/spdx.ts");
1107
- class LicenseFactory {
1108
- makeFromString(value) {
1109
- try {
1110
- return this.makeSpdxLicense(value);
1111
- }
1112
- catch {
1113
- }
1114
- try {
1115
- return this.makeExpression(value);
1116
- }
1117
- catch {
1118
- }
1119
- return this.makeNamedLicense(value);
1120
- }
1121
- makeExpression(value) {
1122
- const expression = String(value);
1123
- if ((0, spdx_1.isValidSpdxLicenseExpression)(expression)) {
1124
- return new license_1.LicenseExpression(expression);
1125
- }
1126
- throw new RangeError('Invalid SPDX license expression');
1127
- }
1128
- makeDisjunctive(value) {
1129
- try {
1130
- return this.makeSpdxLicense(value);
1131
- }
1132
- catch {
1133
- return this.makeNamedLicense(value);
1134
- }
1135
- }
1136
- makeSpdxLicense(value) {
1137
- const fixed = (0, spdx_1.fixupSpdxId)(String(value));
1138
- if (undefined === fixed) {
1139
- throw new RangeError('Unsupported SPDX license ID');
1140
- }
1141
- return new license_1.SpdxLicense(fixed);
1142
- }
1143
- makeNamedLicense(value) {
1144
- return new license_1.NamedLicense(String(value));
1145
- }
1146
- }
1147
- exports.LicenseFactory = LicenseFactory;
1148
-
1149
-
1150
- /***/ }),
1151
-
1152
- /***/ "./src/factories/packageUrl.ts":
1153
- /*!*************************************!*\
1154
- !*** ./src/factories/packageUrl.ts ***!
1155
- \*************************************/
1156
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1157
-
1158
-
1159
- /*!
1160
- This file is part of CycloneDX JavaScript Library.
1161
-
1162
- Licensed under the Apache License, Version 2.0 (the "License");
1163
- you may not use this file except in compliance with the License.
1164
- You may obtain a copy of the License at
1165
-
1166
- http://www.apache.org/licenses/LICENSE-2.0
1167
-
1168
- Unless required by applicable law or agreed to in writing, software
1169
- distributed under the License is distributed on an "AS IS" BASIS,
1170
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1171
- See the License for the specific language governing permissions and
1172
- limitations under the License.
1173
-
1174
- SPDX-License-Identifier: Apache-2.0
1175
- Copyright (c) OWASP Foundation. All Rights Reserved.
1176
- */
1177
- Object.defineProperty(exports, "__esModule", ({ value: true }));
1178
- exports.PackageUrlFactory = void 0;
1179
- const packageurl_js_1 = __webpack_require__(/*! packageurl-js */ "packageurl-js");
1180
- const externalReferenceType_1 = __webpack_require__(/*! ../enums/externalReferenceType */ "./src/enums/externalReferenceType.ts");
1181
- class PackageUrlFactory {
1182
- #type;
1183
- constructor(type) {
1184
- this.#type = type;
1185
- }
1186
- get type() {
1187
- return this.#type;
1188
- }
1189
- makeFromComponent(component, sort = false) {
1190
- const qualifiers = {};
1191
- qualifiers.__proto__ = null;
1192
- let subpath = undefined;
1193
- const extRefs = sort
1194
- ? component.externalReferences.sorted()
1195
- : component.externalReferences;
1196
- for (const extRef of extRefs) {
1197
- const url = extRef.url.toString();
1198
- if (url.length <= 0) {
1199
- continue;
1200
- }
1201
- switch (extRef.type) {
1202
- case externalReferenceType_1.ExternalReferenceType.VCS:
1203
- [qualifiers[packageurl_js_1.PurlQualifierNames.VcsUrl], subpath] = url.split('#', 2);
1204
- break;
1205
- case externalReferenceType_1.ExternalReferenceType.Distribution:
1206
- qualifiers[packageurl_js_1.PurlQualifierNames.DownloadUrl] = url;
1207
- break;
1208
- }
1209
- }
1210
- const hashes = component.hashes;
1211
- if (hashes.size > 0) {
1212
- qualifiers[packageurl_js_1.PurlQualifierNames.Checksum] = Array.from(sort
1213
- ? hashes.sorted()
1214
- : hashes, ([hashAlgo, hashCont]) => `${hashAlgo.toLowerCase()}:${hashCont.toLowerCase()}`).join(',');
1215
- }
1216
- try {
1217
- return new packageurl_js_1.PackageURL(this.#type, component.group, component.name, component.version, qualifiers, subpath);
1218
- }
1219
- catch {
1220
- return undefined;
1221
- }
1222
- }
1223
- }
1224
- exports.PackageUrlFactory = PackageUrlFactory;
1225
-
1226
-
1227
1673
  /***/ }),
1228
1674
 
1229
1675
  /***/ "./src/index.common.ts":
@@ -1357,8 +1803,9 @@ var __importStar = (this && this.__importStar) || (function () {
1357
1803
  };
1358
1804
  })();
1359
1805
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1360
- exports.Validation = exports.Utils = exports.Serialize = exports.Factories = void 0;
1806
+ exports.Validation = exports.Utils = exports.Serialize = exports.Factories = exports.Contrib = void 0;
1361
1807
  __exportStar(__webpack_require__(/*! ./index.common */ "./src/index.common.ts"), exports);
1808
+ exports.Contrib = __importStar(__webpack_require__(/*! ./contrib/index.web */ "./src/contrib/index.web.ts"));
1362
1809
  exports.Factories = __importStar(__webpack_require__(/*! ./factories/index.web */ "./src/factories/index.web.ts"));
1363
1810
  exports.Serialize = __importStar(__webpack_require__(/*! ./serialize/index.web */ "./src/serialize/index.web.ts"));
1364
1811
  exports.Utils = __importStar(__webpack_require__(/*! ./utils/index.web */ "./src/utils/index.web.ts"));
@@ -6657,11 +7104,14 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
6657
7104
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
6658
7105
  };
6659
7106
  Object.defineProperty(exports, "__esModule", ({ value: true }));
7107
+ exports.isNodePackageJson = exports.assertNodePackageJson = void 0;
7108
+ const types_1 = __webpack_require__(/*! ../contrib/fromNodePackageJson/types */ "./src/contrib/fromNodePackageJson/types.ts");
6660
7109
  __exportStar(__webpack_require__(/*! ./cpe */ "./src/types/cpe.ts"), exports);
6661
7110
  __exportStar(__webpack_require__(/*! ./cwe */ "./src/types/cwe.ts"), exports);
6662
7111
  __exportStar(__webpack_require__(/*! ./integer */ "./src/types/integer.ts"), exports);
6663
7112
  __exportStar(__webpack_require__(/*! ./mimeType */ "./src/types/mimeType.ts"), exports);
6664
- __exportStar(__webpack_require__(/*! ./nodePackageJson */ "./src/types/nodePackageJson.ts"), exports);
7113
+ exports.assertNodePackageJson = types_1.assertNodePackageJson;
7114
+ exports.isNodePackageJson = types_1.isNodePackageJson;
6665
7115
 
6666
7116
 
6667
7117
  /***/ }),
@@ -6744,88 +7194,6 @@ function isMimeType(value) {
6744
7194
  }
6745
7195
 
6746
7196
 
6747
- /***/ }),
6748
-
6749
- /***/ "./src/types/nodePackageJson.ts":
6750
- /*!**************************************!*\
6751
- !*** ./src/types/nodePackageJson.ts ***!
6752
- \**************************************/
6753
- /***/ ((__unused_webpack_module, exports) => {
6754
-
6755
-
6756
- /*!
6757
- This file is part of CycloneDX JavaScript Library.
6758
-
6759
- Licensed under the Apache License, Version 2.0 (the "License");
6760
- you may not use this file except in compliance with the License.
6761
- You may obtain a copy of the License at
6762
-
6763
- http://www.apache.org/licenses/LICENSE-2.0
6764
-
6765
- Unless required by applicable law or agreed to in writing, software
6766
- distributed under the License is distributed on an "AS IS" BASIS,
6767
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6768
- See the License for the specific language governing permissions and
6769
- limitations under the License.
6770
-
6771
- SPDX-License-Identifier: Apache-2.0
6772
- Copyright (c) OWASP Foundation. All Rights Reserved.
6773
- */
6774
- Object.defineProperty(exports, "__esModule", ({ value: true }));
6775
- exports.isNodePackageJson = isNodePackageJson;
6776
- exports.assertNodePackageJson = assertNodePackageJson;
6777
- function isNodePackageJson(value) {
6778
- throw new Error('Not implemented');
6779
- }
6780
- function assertNodePackageJson(value) {
6781
- throw new Error('Not implemented');
6782
- }
6783
-
6784
-
6785
- /***/ }),
6786
-
6787
- /***/ "./src/utils/bomUtility.ts":
6788
- /*!*********************************!*\
6789
- !*** ./src/utils/bomUtility.ts ***!
6790
- \*********************************/
6791
- /***/ ((__unused_webpack_module, exports) => {
6792
-
6793
-
6794
- /*!
6795
- This file is part of CycloneDX JavaScript Library.
6796
-
6797
- Licensed under the Apache License, Version 2.0 (the "License");
6798
- you may not use this file except in compliance with the License.
6799
- You may obtain a copy of the License at
6800
-
6801
- http://www.apache.org/licenses/LICENSE-2.0
6802
-
6803
- Unless required by applicable law or agreed to in writing, software
6804
- distributed under the License is distributed on an "AS IS" BASIS,
6805
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6806
- See the License for the specific language governing permissions and
6807
- limitations under the License.
6808
-
6809
- SPDX-License-Identifier: Apache-2.0
6810
- Copyright (c) OWASP Foundation. All Rights Reserved.
6811
- */
6812
- Object.defineProperty(exports, "__esModule", ({ value: true }));
6813
- exports.randomSerialNumber = randomSerialNumber;
6814
- function randomSerialNumber() {
6815
- const b = [
6816
- Math.round(Math.random() * 0xFFFF),
6817
- Math.round(Math.random() * 0xFFFF),
6818
- Math.round(Math.random() * 0xFFFF),
6819
- Math.round(Math.random() * 0x0FFF) | 0x4000,
6820
- Math.round(Math.random() * 0x3FFF) | 0x8000,
6821
- Math.round(Math.random() * 0xFFFF),
6822
- Math.round(Math.random() * 0xFFFF),
6823
- Math.round(Math.random() * 0xFFFF)
6824
- ].map(n => n.toString(16).padStart(4, '0'));
6825
- return `urn:uuid:${b[0]}${b[1]}-${b[2]}-${b[3]}-${b[4]}-${b[5]}${b[6]}${b[7]}`;
6826
- }
6827
-
6828
-
6829
7197
  /***/ }),
6830
7198
 
6831
7199
  /***/ "./src/utils/index.common.ts":
@@ -6888,7 +7256,8 @@ var __importStar = (this && this.__importStar) || (function () {
6888
7256
  })();
6889
7257
  Object.defineProperty(exports, "__esModule", ({ value: true }));
6890
7258
  exports.BomUtility = void 0;
6891
- exports.BomUtility = __importStar(__webpack_require__(/*! ./bomUtility */ "./src/utils/bomUtility.ts"));
7259
+ const _BomUtils = __importStar(__webpack_require__(/*! ../contrib/bom/utils */ "./src/contrib/bom/utils.ts"));
7260
+ exports.BomUtility = _BomUtils;
6892
7261
 
6893
7262
 
6894
7263
  /***/ }),