@cyclonedx/cyclonedx-library 8.1.0 → 8.3.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 (48) hide show
  1. package/dist.d/_helpers/packageJson.d.ts +1 -0
  2. package/dist.d/_helpers/packageJson.d.ts.map +1 -1
  3. package/dist.d/factories/fromNodePackageJson.node.d.ts +1 -0
  4. package/dist.d/factories/fromNodePackageJson.node.d.ts.map +1 -1
  5. package/dist.d/index.common.d.ts +0 -1
  6. package/dist.d/index.common.d.ts.map +1 -1
  7. package/dist.d/index.node.d.ts +1 -0
  8. package/dist.d/index.node.d.ts.map +1 -1
  9. package/dist.d/index.web.d.ts +1 -0
  10. package/dist.d/index.web.d.ts.map +1 -1
  11. package/dist.d/utils/{index.d.ts → index.common.d.ts} +1 -1
  12. package/dist.d/utils/index.common.d.ts.map +1 -0
  13. package/dist.d/utils/index.node.d.ts +21 -0
  14. package/dist.d/utils/index.node.d.ts.map +1 -0
  15. package/dist.d/utils/index.web.d.ts +20 -0
  16. package/dist.d/utils/index.web.d.ts.map +1 -0
  17. package/dist.d/utils/npmjsUtility.node.d.ts +29 -0
  18. package/dist.d/utils/npmjsUtility.node.d.ts.map +1 -0
  19. package/dist.node/factories/fromNodePackageJson.node.js +28 -2
  20. package/dist.node/factories/fromNodePackageJson.node.js.map +1 -1
  21. package/dist.node/index.common.js +1 -2
  22. package/dist.node/index.common.js.map +1 -1
  23. package/dist.node/index.node.js +2 -1
  24. package/dist.node/index.node.js.map +1 -1
  25. package/dist.node/utils/{index.js → index.common.js} +1 -1
  26. package/dist.node/utils/index.common.js.map +1 -0
  27. package/dist.node/utils/index.node.js +60 -0
  28. package/dist.node/utils/index.node.js.map +1 -0
  29. package/dist.node/utils/npmjsUtility.node.js +43 -0
  30. package/dist.node/utils/npmjsUtility.node.js.map +1 -0
  31. package/dist.web/lib.dev.js +53 -8
  32. package/dist.web/lib.dev.js.map +1 -1
  33. package/dist.web/lib.js +1 -1
  34. package/dist.web/lib.js.map +1 -1
  35. package/package.json +3 -3
  36. package/res/schema/spdx.SNAPSHOT.schema.json +29 -1
  37. package/res/schema/spdx.SNAPSHOT.xsd +142 -2
  38. package/src/_helpers/packageJson.ts +1 -0
  39. package/src/factories/fromNodePackageJson.node.ts +32 -9
  40. package/src/index.common.ts +0 -1
  41. package/src/index.node.ts +1 -0
  42. package/src/index.web.ts +1 -0
  43. package/src/utils/index.node.ts +26 -0
  44. package/src/utils/index.web.ts +26 -0
  45. package/src/utils/npmjsUtility.node.ts +89 -0
  46. package/dist.d/utils/index.d.ts.map +0 -1
  47. package/dist.node/utils/index.js.map +0 -1
  48. /package/src/utils/{index.ts → index.common.ts} +0 -0
@@ -52,5 +52,6 @@ export interface PackageJson {
52
52
  url?: string;
53
53
  directory?: string;
54
54
  };
55
+ dist?: any;
55
56
  }
56
57
  //# sourceMappingURL=packageJson.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageJson.d.ts","sourceRoot":"","sources":["../../src/_helpers/packageJson.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;AAEF;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAE,IAAI,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAO/D;AAED;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,KAAK,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,GAAG,CAAC,EAAE,MAAM,CAAA;KACb,CAAC,CAAA;IACF,MAAM,CAAC,EAAE,MAAM,GAAG;QAChB,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,KAAK,CAAC,EAAE,MAAM,CAAA;KACf,CAAA;IAC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ACX"}
@@ -37,6 +37,7 @@ export declare class ExternalReferenceFactory {
37
37
  makeVcs(data: PackageJson): ExternalReference | undefined;
38
38
  makeHomepage(data: PackageJson): ExternalReference | undefined;
39
39
  makeIssueTracker(data: PackageJson): ExternalReference | undefined;
40
+ makeDist(data: PackageJson): ExternalReference | undefined;
40
41
  }
41
42
  /**
42
43
  * Node-specific PackageUrlFactory.
@@ -1 +1 @@
1
- {"version":3,"file":"fromNodePackageJson.node.d.ts","sourceRoot":"","sources":["../../src/factories/fromNodePackageJson.node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;AAEF;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAK/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAE1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAC/D,OAAO,EAAE,iBAAiB,IAAI,sBAAsB,EAAE,MAAM,cAAc,CAAA;AAE1E;;GAEG;AACH,qBAAa,wBAAwB;IACnC,sBAAsB,CAAE,IAAI,EAAE,WAAW,GAAG,iBAAiB,EAAE;IAU/D,OAAO,CAAE,IAAI,EAAE,WAAW,GAAG,iBAAiB,GAAG,SAAS;IAuB1D,YAAY,CAAE,IAAI,EAAE,WAAW,GAAG,iBAAiB,GAAG,SAAS;IAU/D,gBAAgB,CAAE,IAAI,EAAE,WAAW,GAAG,iBAAiB,GAAG,SAAS;CAgBpE;AAQD;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,sBAAsB,CAAC,KAAK,CAAC;;IAEzD,iBAAiB,CAAE,SAAS,EAAE,SAAS,EAAE,IAAI,GAAE,OAAe,GAAG,UAAU,GAAG,SAAS;CA4CjG"}
1
+ {"version":3,"file":"fromNodePackageJson.node.d.ts","sourceRoot":"","sources":["../../src/factories/fromNodePackageJson.node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;AAEF;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAK/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAG1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAG/D,OAAO,EAAE,iBAAiB,IAAI,sBAAsB,EAAE,MAAM,cAAc,CAAA;AAE1E;;GAEG;AACH,qBAAa,wBAAwB;IACnC,sBAAsB,CAAE,IAAI,EAAE,WAAW,GAAG,iBAAiB,EAAE;IAW/D,OAAO,CAAE,IAAI,EAAE,WAAW,GAAG,iBAAiB,GAAG,SAAS;IAuB1D,YAAY,CAAE,IAAI,EAAE,WAAW,GAAG,iBAAiB,GAAG,SAAS;IAU/D,gBAAgB,CAAE,IAAI,EAAE,WAAW,GAAG,iBAAiB,GAAG,SAAS;IAiBnE,QAAQ,CAAC,IAAI,EAAE,WAAW,GAAG,iBAAiB,GAAG,SAAS;CAwB3D;AAED;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,sBAAsB,CAAC,KAAK,CAAC;;IAEzD,iBAAiB,CAAE,SAAS,EAAE,SAAS,EAAE,IAAI,GAAE,OAAe,GAAG,UAAU,GAAG,SAAS;CA4CjG"}
@@ -21,5 +21,4 @@ export * as Models from './models';
21
21
  export * as SPDX from './spdx';
22
22
  export * as Spec from './spec';
23
23
  export * as Types from './types';
24
- export * as Utils from './utils';
25
24
  //# sourceMappingURL=index.common.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.common.d.ts","sourceRoot":"","sources":["../src/index.common.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;AAEF,OAAO,KAAK,KAAK,MAAM,SAAS,CAAA;AAChC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAA;AAClC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAA;AAC9B,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAA;AAC9B,OAAO,KAAK,KAAK,MAAM,SAAS,CAAA;AAChC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAA"}
1
+ {"version":3,"file":"index.common.d.ts","sourceRoot":"","sources":["../src/index.common.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;AAEF,OAAO,KAAK,KAAK,MAAM,SAAS,CAAA;AAChC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAA;AAClC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAA;AAC9B,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAA;AAC9B,OAAO,KAAK,KAAK,MAAM,SAAS,CAAA"}
@@ -20,5 +20,6 @@ export * from './index.common';
20
20
  export * as Builders from './builders/index.node';
21
21
  export * as Factories from './factories/index.node';
22
22
  export * as Serialize from './serialize/index.node';
23
+ export * as Utils from './utils/index.node';
23
24
  export * as Validation from './validation/index.node';
24
25
  //# sourceMappingURL=index.node.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.node.d.ts","sourceRoot":"","sources":["../src/index.node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;AAMF,cAAc,gBAAgB,CAAA;AAI9B,OAAO,KAAK,QAAQ,MAAM,uBAAuB,CAAA;AACjD,OAAO,KAAK,SAAS,MAAM,wBAAwB,CAAA;AACnD,OAAO,KAAK,SAAS,MAAM,wBAAwB,CAAA;AACnD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAA"}
1
+ {"version":3,"file":"index.node.d.ts","sourceRoot":"","sources":["../src/index.node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;AAMF,cAAc,gBAAgB,CAAA;AAI9B,OAAO,KAAK,QAAQ,MAAM,uBAAuB,CAAA;AACjD,OAAO,KAAK,SAAS,MAAM,wBAAwB,CAAA;AACnD,OAAO,KAAK,SAAS,MAAM,wBAAwB,CAAA;AACnD,OAAO,KAAK,KAAK,MAAM,oBAAoB,CAAA;AAC3C,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAA"}
@@ -19,5 +19,6 @@ Copyright (c) OWASP Foundation. All Rights Reserved.
19
19
  export * from './index.common';
20
20
  export * as Factories from './factories/index.web';
21
21
  export * as Serialize from './serialize/index.web';
22
+ export * as Utils from './utils/index.web';
22
23
  export * as Validation from './validation/index.web';
23
24
  //# sourceMappingURL=index.web.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../src/index.web.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;AAEF,cAAc,gBAAgB,CAAA;AAI9B,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAA;AAClD,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAA;AAClD,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAA"}
1
+ {"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../src/index.web.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;AAEF,cAAc,gBAAgB,CAAA;AAI9B,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAA;AAClD,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAA;AAClD,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAA;AAC1C,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAA"}
@@ -17,4 +17,4 @@ SPDX-License-Identifier: Apache-2.0
17
17
  Copyright (c) OWASP Foundation. All Rights Reserved.
18
18
  */
19
19
  export * as BomUtility from './bomUtility';
20
- //# sourceMappingURL=index.d.ts.map
20
+ //# sourceMappingURL=index.common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.common.d.ts","sourceRoot":"","sources":["../../src/utils/index.common.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;AAEF,OAAO,KAAK,UAAU,MAAM,cAAc,CAAA"}
@@ -0,0 +1,21 @@
1
+ /*!
2
+ This file is part of CycloneDX JavaScript Library.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+
16
+ SPDX-License-Identifier: Apache-2.0
17
+ Copyright (c) OWASP Foundation. All Rights Reserved.
18
+ */
19
+ export * from './index.common';
20
+ export * as NpmjsUtility from './npmjsUtility.node';
21
+ //# sourceMappingURL=index.node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.node.d.ts","sourceRoot":"","sources":["../../src/utils/index.node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;AAEF,cAAc,gBAAgB,CAAA;AAI9B,OAAO,KAAK,YAAY,MAAM,qBAAqB,CAAA"}
@@ -0,0 +1,20 @@
1
+ /*!
2
+ This file is part of CycloneDX JavaScript Library.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+
16
+ SPDX-License-Identifier: Apache-2.0
17
+ Copyright (c) OWASP Foundation. All Rights Reserved.
18
+ */
19
+ export * from './index.common';
20
+ //# sourceMappingURL=index.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../src/utils/index.web.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;AAEF,cAAc,gBAAgB,CAAA"}
@@ -0,0 +1,29 @@
1
+ /*!
2
+ This file is part of CycloneDX JavaScript Library.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+
16
+ SPDX-License-Identifier: Apache-2.0
17
+ Copyright (c) OWASP Foundation. All Rights Reserved.
18
+ */
19
+ import { HashAlgorithm } from '../enums/hashAlogorithm';
20
+ /**
21
+ * @throws {@link RangeError} if value is unparsable
22
+ */
23
+ export declare function parsePackageIntegrity(integrity: string): [HashAlgorithm, string];
24
+ /**
25
+ * The default registry is `https://registry.npmjs.org`.
26
+ * @see {@link https://github.com/package-url/purl-spec/blob/master/PURL-TYPES.rst#npm}
27
+ */
28
+ export declare const defaultRegistryMatcher: RegExp;
29
+ //# sourceMappingURL=npmjsUtility.node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"npmjsUtility.node.d.ts","sourceRoot":"","sources":["../../src/utils/npmjsUtility.node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;EAiBE;AAEF,OAAO,EAAC,aAAa,EAAC,MAAM,yBAAyB,CAAA;AAgDrD;;GAEG;AACH,wBAAgB,qBAAqB,CAAE,SAAS,EAAE,MAAM,GAAG,CAAC,aAAa,EAAE,MAAM,CAAC,CAWjF;AAGD;;;GAGG;AACH,eAAO,MAAM,sBAAsB,QAA6C,CAAA"}
@@ -23,7 +23,10 @@ const packageurl_js_1 = require("packageurl-js");
23
23
  const gitUrl_1 = require("../_helpers/gitUrl");
24
24
  const notUndefined_1 = require("../_helpers/notUndefined");
25
25
  const externalReferenceType_1 = require("../enums/externalReferenceType");
26
+ const hashAlogorithm_1 = require("../enums/hashAlogorithm");
26
27
  const externalReference_1 = require("../models/externalReference");
28
+ const hash_1 = require("../models/hash");
29
+ const npmjsUtility_node_1 = require("../utils/npmjsUtility.node");
27
30
  const packageUrl_1 = require("./packageUrl");
28
31
  class ExternalReferenceFactory {
29
32
  makeExternalReferences(data) {
@@ -40,6 +43,10 @@ class ExternalReferenceFactory {
40
43
  refs.push(this.makeIssueTracker(data));
41
44
  }
42
45
  catch { }
46
+ try {
47
+ refs.push(this.makeDist(data));
48
+ }
49
+ catch { }
43
50
  return refs.filter(notUndefined_1.isNotUndefined);
44
51
  }
45
52
  makeVcs(data) {
@@ -84,9 +91,28 @@ class ExternalReferenceFactory {
84
91
  ? new externalReference_1.ExternalReference(url, externalReferenceType_1.ExternalReferenceType.IssueTracker, { comment })
85
92
  : undefined;
86
93
  }
94
+ makeDist(data) {
95
+ const { tarball, integrity, shasum } = data.dist ?? {};
96
+ if (typeof tarball === 'string') {
97
+ const hashes = new hash_1.HashDictionary();
98
+ let comment = 'as detected from PackageJson property "dist.tarball"';
99
+ if (typeof integrity === 'string') {
100
+ try {
101
+ hashes.set(...(0, npmjsUtility_node_1.parsePackageIntegrity)(integrity));
102
+ comment += ' and property "dist.integrity"';
103
+ }
104
+ catch { }
105
+ }
106
+ if (typeof shasum === 'string' && shasum.length === 40) {
107
+ hashes.set(hashAlogorithm_1.HashAlgorithm["SHA-1"], shasum);
108
+ comment += ' and property "dist.shasum"';
109
+ }
110
+ return new externalReference_1.ExternalReference(tarball, externalReferenceType_1.ExternalReferenceType.Distribution, { hashes, comment });
111
+ }
112
+ return undefined;
113
+ }
87
114
  }
88
115
  exports.ExternalReferenceFactory = ExternalReferenceFactory;
89
- const npmDefaultRepositoryMatcher = /^https?:\/\/registry\.npmjs\.org(:?\/|$)/;
90
116
  class PackageUrlFactory extends packageUrl_1.PackageUrlFactory {
91
117
  makeFromComponent(component, sort = false) {
92
118
  const purl = super.makeFromComponent(component, sort);
@@ -99,7 +125,7 @@ class PackageUrlFactory extends packageUrl_1.PackageUrlFactory {
99
125
  const downloadUrl = qualifiers.get(packageurl_js_1.PurlQualifierNames.DownloadUrl);
100
126
  if (downloadUrl !== undefined) {
101
127
  qualifiers.delete(packageurl_js_1.PurlQualifierNames.VcsUrl);
102
- if (npmDefaultRepositoryMatcher.test(downloadUrl)) {
128
+ if (npmjsUtility_node_1.defaultRegistryMatcher.test(downloadUrl)) {
103
129
  qualifiers.delete(packageurl_js_1.PurlQualifierNames.DownloadUrl);
104
130
  }
105
131
  }
@@ -1 +1 @@
1
- {"version":3,"file":"fromNodePackageJson.node.js","sourceRoot":"","sources":["../../src/factories/fromNodePackageJson.node.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;EAiBE;;;AAYF,iDAAkD;AAElD,+CAAwD;AACxD,2DAAyD;AAEzD,0EAAsE;AAEtE,mEAA+D;AAC/D,6CAA0E;AAK1E,MAAa,wBAAwB;IACnC,sBAAsB,CAAE,IAAiB;QACvC,MAAM,IAAI,GAAyC,EAAE,CAAA;QAErD,IAAI,CAAC;YAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAA;QAAC,CAAC;QAAC,MAAM,CAAC,CAAY,CAAC;QAC1D,IAAI,CAAC;YAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAA;QAAC,CAAC;QAAC,MAAM,CAAC,CAAY,CAAC;QAC/D,IAAI,CAAC;YAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAA;QAAC,CAAC;QAAC,MAAM,CAAC,CAAY,CAAC;QAEnE,OAAO,IAAI,CAAC,MAAM,CAAC,6BAAc,CAAC,CAAA;IACpC,CAAC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AAC,WAAW,CAAC,EAAE,CAAC;gBAC7C,UAAU,CAAC,MAAM,CAAC,kCAAkB,CAAC,WAAW,CAAC,CAAA;YACnD,CAAC;QACH,CAAC;QACD,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,kCAAkB,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,kCAAkB,CAAC,MAAM,CAAC,EAAE,CAAC;YAElG,UAAU,CAAC,MAAM,CAAC,kCAAkB,CAAC,QAAQ,CAAC,CAAA;QAChD,CAAC;QACD,IAAI,UAAU,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;YACxB,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,CAAA;YAE1D,IAAI,CAAC,UAAU,CAAC,SAAS,GAAG,IAAI,CAAA;QAClC,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,UAAU,GAAG,SAAS,CAAA;QAC7B,CAAC;QAED,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AA9CD,8CA8CC"}
@@ -51,11 +51,10 @@ var __importStar = (this && this.__importStar) || (function () {
51
51
  };
52
52
  })();
53
53
  Object.defineProperty(exports, "__esModule", { value: true });
54
- exports.Utils = exports.Types = exports.Spec = exports.SPDX = exports.Models = exports.Enums = void 0;
54
+ exports.Types = exports.Spec = exports.SPDX = exports.Models = exports.Enums = void 0;
55
55
  exports.Enums = __importStar(require("./enums"));
56
56
  exports.Models = __importStar(require("./models"));
57
57
  exports.SPDX = __importStar(require("./spdx"));
58
58
  exports.Spec = __importStar(require("./spec"));
59
59
  exports.Types = __importStar(require("./types"));
60
- exports.Utils = __importStar(require("./utils"));
61
60
  //# sourceMappingURL=index.common.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.common.js","sourceRoot":"","sources":["../src/index.common.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;EAiBE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEF,iDAAgC;AAChC,mDAAkC;AAClC,+CAA8B;AAC9B,+CAA8B;AAC9B,iDAAgC;AAChC,iDAAgC"}
1
+ {"version":3,"file":"index.common.js","sourceRoot":"","sources":["../src/index.common.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;EAiBE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEF,iDAAgC;AAChC,mDAAkC;AAClC,+CAA8B;AAC9B,+CAA8B;AAC9B,iDAAgC"}
@@ -54,11 +54,12 @@ var __importStar = (this && this.__importStar) || (function () {
54
54
  };
55
55
  })();
56
56
  Object.defineProperty(exports, "__esModule", { value: true });
57
- exports._Resources = exports.Validation = exports.Serialize = exports.Factories = exports.Builders = void 0;
57
+ exports._Resources = exports.Validation = exports.Utils = exports.Serialize = exports.Factories = exports.Builders = void 0;
58
58
  __exportStar(require("./index.common"), exports);
59
59
  exports.Builders = __importStar(require("./builders/index.node"));
60
60
  exports.Factories = __importStar(require("./factories/index.node"));
61
61
  exports.Serialize = __importStar(require("./serialize/index.node"));
62
+ exports.Utils = __importStar(require("./utils/index.node"));
62
63
  exports.Validation = __importStar(require("./validation/index.node"));
63
64
  exports._Resources = __importStar(require("./resources.node"));
64
65
  //# sourceMappingURL=index.node.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.node.js","sourceRoot":"","sources":["../src/index.node.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;EAiBE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMF,iDAA8B;AAI9B,kEAAiD;AACjD,oEAAmD;AACnD,oEAAmD;AACnD,sEAAqD;AAOrD,+DAA8C"}
1
+ {"version":3,"file":"index.node.js","sourceRoot":"","sources":["../src/index.node.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;EAiBE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMF,iDAA8B;AAI9B,kEAAiD;AACjD,oEAAmD;AACnD,oEAAmD;AACnD,4DAA2C;AAC3C,sEAAqD;AAOrD,+DAA8C"}
@@ -53,4 +53,4 @@ var __importStar = (this && this.__importStar) || (function () {
53
53
  Object.defineProperty(exports, "__esModule", { value: true });
54
54
  exports.BomUtility = void 0;
55
55
  exports.BomUtility = __importStar(require("./bomUtility"));
56
- //# sourceMappingURL=index.js.map
56
+ //# sourceMappingURL=index.common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.common.js","sourceRoot":"","sources":["../../src/utils/index.common.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;EAiBE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEF,2DAA0C"}
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ /*!
3
+ This file is part of CycloneDX JavaScript Library.
4
+
5
+ Licensed under the Apache License, Version 2.0 (the "License");
6
+ you may not use this file except in compliance with the License.
7
+ You may obtain a copy of the License at
8
+
9
+ http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+ Unless required by applicable law or agreed to in writing, software
12
+ distributed under the License is distributed on an "AS IS" BASIS,
13
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ See the License for the specific language governing permissions and
15
+ limitations under the License.
16
+
17
+ SPDX-License-Identifier: Apache-2.0
18
+ Copyright (c) OWASP Foundation. All Rights Reserved.
19
+ */
20
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ var desc = Object.getOwnPropertyDescriptor(m, k);
23
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
24
+ desc = { enumerable: true, get: function() { return m[k]; } };
25
+ }
26
+ Object.defineProperty(o, k2, desc);
27
+ }) : (function(o, m, k, k2) {
28
+ if (k2 === undefined) k2 = k;
29
+ o[k2] = m[k];
30
+ }));
31
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
32
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
33
+ }) : function(o, v) {
34
+ o["default"] = v;
35
+ });
36
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
37
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
38
+ };
39
+ var __importStar = (this && this.__importStar) || (function () {
40
+ var ownKeys = function(o) {
41
+ ownKeys = Object.getOwnPropertyNames || function (o) {
42
+ var ar = [];
43
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
44
+ return ar;
45
+ };
46
+ return ownKeys(o);
47
+ };
48
+ return function (mod) {
49
+ if (mod && mod.__esModule) return mod;
50
+ var result = {};
51
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
52
+ __setModuleDefault(result, mod);
53
+ return result;
54
+ };
55
+ })();
56
+ Object.defineProperty(exports, "__esModule", { value: true });
57
+ exports.NpmjsUtility = void 0;
58
+ __exportStar(require("./index.common"), exports);
59
+ exports.NpmjsUtility = __importStar(require("./npmjsUtility.node"));
60
+ //# sourceMappingURL=index.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.node.js","sourceRoot":"","sources":["../../src/utils/index.node.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;EAiBE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEF,iDAA8B;AAI9B,oEAAmD"}
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ /*!
3
+ This file is part of CycloneDX JavaScript Library.
4
+
5
+ Licensed under the Apache License, Version 2.0 (the "License");
6
+ you may not use this file except in compliance with the License.
7
+ You may obtain a copy of the License at
8
+
9
+ http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+ Unless required by applicable law or agreed to in writing, software
12
+ distributed under the License is distributed on an "AS IS" BASIS,
13
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ See the License for the specific language governing permissions and
15
+ limitations under the License.
16
+
17
+ SPDX-License-Identifier: Apache-2.0
18
+ Copyright (c) OWASP Foundation. All Rights Reserved.
19
+ */
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ exports.defaultRegistryMatcher = void 0;
22
+ exports.parsePackageIntegrity = parsePackageIntegrity;
23
+ const hashAlogorithm_1 = require("../enums/hashAlogorithm");
24
+ const integrityRE = new Map([
25
+ [hashAlogorithm_1.HashAlgorithm['SHA-512'], /^sha512-([a-z0-9+/]{86}==)$/i],
26
+ [hashAlogorithm_1.HashAlgorithm['SHA-1'], /^sha1-([a-z0-9+/]{27}=)$/i],
27
+ [hashAlogorithm_1.HashAlgorithm['SHA-256'], /^sha256-([a-z0-9+/]{43}=)$/i],
28
+ [hashAlogorithm_1.HashAlgorithm['SHA-384'], /^sha384-([a-z0-9+/]{64})$/i]
29
+ ]);
30
+ function parsePackageIntegrity(integrity) {
31
+ for (const [hashAlgorithm, hashRE] of integrityRE) {
32
+ const hashMatchBase64 = hashRE.exec(integrity) ?? [];
33
+ if (hashMatchBase64.length === 2) {
34
+ return [
35
+ hashAlgorithm,
36
+ Buffer.from(hashMatchBase64[1], 'base64').toString('hex')
37
+ ];
38
+ }
39
+ }
40
+ throw new RangeError('unparsable value');
41
+ }
42
+ exports.defaultRegistryMatcher = /^https?:\/\/registry\.npmjs\.org(:?\/|$)/;
43
+ //# sourceMappingURL=npmjsUtility.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"npmjsUtility.node.js","sourceRoot":"","sources":["../../src/utils/npmjsUtility.node.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;EAiBE;;;AAqDF,sDAWC;AA9DD,4DAAqD;AAQrD,MAAM,WAAW,GAAuC,IAAI,GAAG,CAAC;IAU9D,CAAC,8BAAa,CAAC,SAAS,CAAC,EAAE,8BAA8B,CAAC;IAS1D,CAAC,8BAAa,CAAC,OAAO,CAAC,EAAE,2BAA2B,CAAC;IASrD,CAAC,8BAAa,CAAC,SAAS,CAAC,EAAE,6BAA6B,CAAC;IASzD,CAAC,8BAAa,CAAC,SAAS,CAAC,EAAE,4BAA4B,CAAC;CACzD,CAAC,CAAA;AAKF,SAAgB,qBAAqB,CAAE,SAAiB;IACtD,KAAK,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,IAAI,WAAW,EAAE,CAAC;QAClD,MAAM,eAAe,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAA;QACpD,IAAI,eAAe,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACjC,OAAO;gBACL,aAAa;gBACb,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC;aAC1D,CAAA;QACH,CAAC;IACH,CAAC;IACD,MAAM,IAAI,UAAU,CAAC,kBAAkB,CAAC,CAAA;AAC1C,CAAC;AAOY,QAAA,sBAAsB,GAAG,0CAA0C,CAAA"}
@@ -18,7 +18,7 @@ return /******/ (() => { // webpackBootstrap
18
18
  \**********************************************/
19
19
  /***/ ((module) => {
20
20
 
21
- module.exports = /*#__PURE__*/JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://cyclonedx.org/schema/spdx.schema.json","$comment":"v1.0-3.24.0","type":"string","enum":["0BSD","3D-Slicer-1.0","AAL","Abstyles","AdaCore-doc","Adobe-2006","Adobe-Display-PostScript","Adobe-Glyph","Adobe-Utopia","ADSL","AFL-1.1","AFL-1.2","AFL-2.0","AFL-2.1","AFL-3.0","Afmparse","AGPL-1.0","AGPL-1.0-only","AGPL-1.0-or-later","AGPL-3.0","AGPL-3.0-only","AGPL-3.0-or-later","Aladdin","AMD-newlib","AMDPLPA","AML","AML-glslang","AMPAS","ANTLR-PD","ANTLR-PD-fallback","any-OSI","Apache-1.0","Apache-1.1","Apache-2.0","APAFML","APL-1.0","App-s2p","APSL-1.0","APSL-1.1","APSL-1.2","APSL-2.0","Arphic-1999","Artistic-1.0","Artistic-1.0-cl8","Artistic-1.0-Perl","Artistic-2.0","ASWF-Digital-Assets-1.0","ASWF-Digital-Assets-1.1","Baekmuk","Bahyph","Barr","bcrypt-Solar-Designer","Beerware","Bitstream-Charter","Bitstream-Vera","BitTorrent-1.0","BitTorrent-1.1","blessing","BlueOak-1.0.0","Boehm-GC","Borceux","Brian-Gladman-2-Clause","Brian-Gladman-3-Clause","BSD-1-Clause","BSD-2-Clause","BSD-2-Clause-Darwin","BSD-2-Clause-first-lines","BSD-2-Clause-FreeBSD","BSD-2-Clause-NetBSD","BSD-2-Clause-Patent","BSD-2-Clause-Views","BSD-3-Clause","BSD-3-Clause-acpica","BSD-3-Clause-Attribution","BSD-3-Clause-Clear","BSD-3-Clause-flex","BSD-3-Clause-HP","BSD-3-Clause-LBNL","BSD-3-Clause-Modification","BSD-3-Clause-No-Military-License","BSD-3-Clause-No-Nuclear-License","BSD-3-Clause-No-Nuclear-License-2014","BSD-3-Clause-No-Nuclear-Warranty","BSD-3-Clause-Open-MPI","BSD-3-Clause-Sun","BSD-4-Clause","BSD-4-Clause-Shortened","BSD-4-Clause-UC","BSD-4.3RENO","BSD-4.3TAHOE","BSD-Advertising-Acknowledgement","BSD-Attribution-HPND-disclaimer","BSD-Inferno-Nettverk","BSD-Protection","BSD-Source-beginning-file","BSD-Source-Code","BSD-Systemics","BSD-Systemics-W3Works","BSL-1.0","BUSL-1.1","bzip2-1.0.5","bzip2-1.0.6","C-UDA-1.0","CAL-1.0","CAL-1.0-Combined-Work-Exception","Caldera","Caldera-no-preamble","Catharon","CATOSL-1.1","CC-BY-1.0","CC-BY-2.0","CC-BY-2.5","CC-BY-2.5-AU","CC-BY-3.0","CC-BY-3.0-AT","CC-BY-3.0-AU","CC-BY-3.0-DE","CC-BY-3.0-IGO","CC-BY-3.0-NL","CC-BY-3.0-US","CC-BY-4.0","CC-BY-NC-1.0","CC-BY-NC-2.0","CC-BY-NC-2.5","CC-BY-NC-3.0","CC-BY-NC-3.0-DE","CC-BY-NC-4.0","CC-BY-NC-ND-1.0","CC-BY-NC-ND-2.0","CC-BY-NC-ND-2.5","CC-BY-NC-ND-3.0","CC-BY-NC-ND-3.0-DE","CC-BY-NC-ND-3.0-IGO","CC-BY-NC-ND-4.0","CC-BY-NC-SA-1.0","CC-BY-NC-SA-2.0","CC-BY-NC-SA-2.0-DE","CC-BY-NC-SA-2.0-FR","CC-BY-NC-SA-2.0-UK","CC-BY-NC-SA-2.5","CC-BY-NC-SA-3.0","CC-BY-NC-SA-3.0-DE","CC-BY-NC-SA-3.0-IGO","CC-BY-NC-SA-4.0","CC-BY-ND-1.0","CC-BY-ND-2.0","CC-BY-ND-2.5","CC-BY-ND-3.0","CC-BY-ND-3.0-DE","CC-BY-ND-4.0","CC-BY-SA-1.0","CC-BY-SA-2.0","CC-BY-SA-2.0-UK","CC-BY-SA-2.1-JP","CC-BY-SA-2.5","CC-BY-SA-3.0","CC-BY-SA-3.0-AT","CC-BY-SA-3.0-DE","CC-BY-SA-3.0-IGO","CC-BY-SA-4.0","CC-PDDC","CC0-1.0","CDDL-1.0","CDDL-1.1","CDL-1.0","CDLA-Permissive-1.0","CDLA-Permissive-2.0","CDLA-Sharing-1.0","CECILL-1.0","CECILL-1.1","CECILL-2.0","CECILL-2.1","CECILL-B","CECILL-C","CERN-OHL-1.1","CERN-OHL-1.2","CERN-OHL-P-2.0","CERN-OHL-S-2.0","CERN-OHL-W-2.0","CFITSIO","check-cvs","checkmk","ClArtistic","Clips","CMU-Mach","CMU-Mach-nodoc","CNRI-Jython","CNRI-Python","CNRI-Python-GPL-Compatible","COIL-1.0","Community-Spec-1.0","Condor-1.1","copyleft-next-0.3.0","copyleft-next-0.3.1","Cornell-Lossless-JPEG","CPAL-1.0","CPL-1.0","CPOL-1.02","Cronyx","Crossword","CrystalStacker","CUA-OPL-1.0","Cube","curl","cve-tou","D-FSL-1.0","DEC-3-Clause","diffmark","DL-DE-BY-2.0","DL-DE-ZERO-2.0","DOC","Dotseqn","DRL-1.0","DRL-1.1","DSDP","dtoa","dvipdfm","ECL-1.0","ECL-2.0","eCos-2.0","EFL-1.0","EFL-2.0","eGenix","Elastic-2.0","Entessa","EPICS","EPL-1.0","EPL-2.0","ErlPL-1.1","etalab-2.0","EUDatagrid","EUPL-1.0","EUPL-1.1","EUPL-1.2","Eurosym","Fair","FBM","FDK-AAC","Ferguson-Twofish","Frameworx-1.0","FreeBSD-DOC","FreeImage","FSFAP","FSFAP-no-warranty-disclaimer","FSFUL","FSFULLR","FSFULLRWD","FTL","Furuseth","fwlw","GCR-docs","GD","GFDL-1.1","GFDL-1.1-invariants-only","GFDL-1.1-invariants-or-later","GFDL-1.1-no-invariants-only","GFDL-1.1-no-invariants-or-later","GFDL-1.1-only","GFDL-1.1-or-later","GFDL-1.2","GFDL-1.2-invariants-only","GFDL-1.2-invariants-or-later","GFDL-1.2-no-invariants-only","GFDL-1.2-no-invariants-or-later","GFDL-1.2-only","GFDL-1.2-or-later","GFDL-1.3","GFDL-1.3-invariants-only","GFDL-1.3-invariants-or-later","GFDL-1.3-no-invariants-only","GFDL-1.3-no-invariants-or-later","GFDL-1.3-only","GFDL-1.3-or-later","Giftware","GL2PS","Glide","Glulxe","GLWTPL","gnuplot","GPL-1.0","GPL-1.0+","GPL-1.0-only","GPL-1.0-or-later","GPL-2.0","GPL-2.0+","GPL-2.0-only","GPL-2.0-or-later","GPL-2.0-with-autoconf-exception","GPL-2.0-with-bison-exception","GPL-2.0-with-classpath-exception","GPL-2.0-with-font-exception","GPL-2.0-with-GCC-exception","GPL-3.0","GPL-3.0+","GPL-3.0-only","GPL-3.0-or-later","GPL-3.0-with-autoconf-exception","GPL-3.0-with-GCC-exception","Graphics-Gems","gSOAP-1.3b","gtkbook","Gutmann","HaskellReport","hdparm","Hippocratic-2.1","HP-1986","HP-1989","HPND","HPND-DEC","HPND-doc","HPND-doc-sell","HPND-export-US","HPND-export-US-acknowledgement","HPND-export-US-modify","HPND-export2-US","HPND-Fenneberg-Livingston","HPND-INRIA-IMAG","HPND-Intel","HPND-Kevlin-Henney","HPND-Markus-Kuhn","HPND-merchantability-variant","HPND-MIT-disclaimer","HPND-Pbmplus","HPND-sell-MIT-disclaimer-xserver","HPND-sell-regexpr","HPND-sell-variant","HPND-sell-variant-MIT-disclaimer","HPND-sell-variant-MIT-disclaimer-rev","HPND-UC","HPND-UC-export-US","HTMLTIDY","IBM-pibs","ICU","IEC-Code-Components-EULA","IJG","IJG-short","ImageMagick","iMatix","Imlib2","Info-ZIP","Inner-Net-2.0","Intel","Intel-ACPI","Interbase-1.0","IPA","IPL-1.0","ISC","ISC-Veillard","Jam","JasPer-2.0","JPL-image","JPNIC","JSON","Kastrup","Kazlib","Knuth-CTAN","LAL-1.2","LAL-1.3","Latex2e","Latex2e-translated-notice","Leptonica","LGPL-2.0","LGPL-2.0+","LGPL-2.0-only","LGPL-2.0-or-later","LGPL-2.1","LGPL-2.1+","LGPL-2.1-only","LGPL-2.1-or-later","LGPL-3.0","LGPL-3.0+","LGPL-3.0-only","LGPL-3.0-or-later","LGPLLR","Libpng","libpng-2.0","libselinux-1.0","libtiff","libutil-David-Nugent","LiLiQ-P-1.1","LiLiQ-R-1.1","LiLiQ-Rplus-1.1","Linux-man-pages-1-para","Linux-man-pages-copyleft","Linux-man-pages-copyleft-2-para","Linux-man-pages-copyleft-var","Linux-OpenIB","LOOP","LPD-document","LPL-1.0","LPL-1.02","LPPL-1.0","LPPL-1.1","LPPL-1.2","LPPL-1.3a","LPPL-1.3c","lsof","Lucida-Bitmap-Fonts","LZMA-SDK-9.11-to-9.20","LZMA-SDK-9.22","Mackerras-3-Clause","Mackerras-3-Clause-acknowledgment","magaz","mailprio","MakeIndex","Martin-Birgmeier","McPhee-slideshow","metamail","Minpack","MirOS","MIT","MIT-0","MIT-advertising","MIT-CMU","MIT-enna","MIT-feh","MIT-Festival","MIT-Khronos-old","MIT-Modern-Variant","MIT-open-group","MIT-testregex","MIT-Wu","MITNFA","MMIXware","Motosoto","MPEG-SSG","mpi-permissive","mpich2","MPL-1.0","MPL-1.1","MPL-2.0","MPL-2.0-no-copyleft-exception","mplus","MS-LPL","MS-PL","MS-RL","MTLL","MulanPSL-1.0","MulanPSL-2.0","Multics","Mup","NAIST-2003","NASA-1.3","Naumen","NBPL-1.0","NCBI-PD","NCGL-UK-2.0","NCL","NCSA","Net-SNMP","NetCDF","Newsletr","NGPL","NICTA-1.0","NIST-PD","NIST-PD-fallback","NIST-Software","NLOD-1.0","NLOD-2.0","NLPL","Nokia","NOSL","Noweb","NPL-1.0","NPL-1.1","NPOSL-3.0","NRL","NTP","NTP-0","Nunit","O-UDA-1.0","OAR","OCCT-PL","OCLC-2.0","ODbL-1.0","ODC-By-1.0","OFFIS","OFL-1.0","OFL-1.0-no-RFN","OFL-1.0-RFN","OFL-1.1","OFL-1.1-no-RFN","OFL-1.1-RFN","OGC-1.0","OGDL-Taiwan-1.0","OGL-Canada-2.0","OGL-UK-1.0","OGL-UK-2.0","OGL-UK-3.0","OGTSL","OLDAP-1.1","OLDAP-1.2","OLDAP-1.3","OLDAP-1.4","OLDAP-2.0","OLDAP-2.0.1","OLDAP-2.1","OLDAP-2.2","OLDAP-2.2.1","OLDAP-2.2.2","OLDAP-2.3","OLDAP-2.4","OLDAP-2.5","OLDAP-2.6","OLDAP-2.7","OLDAP-2.8","OLFL-1.3","OML","OpenPBS-2.3","OpenSSL","OpenSSL-standalone","OpenVision","OPL-1.0","OPL-UK-3.0","OPUBL-1.0","OSET-PL-2.1","OSL-1.0","OSL-1.1","OSL-2.0","OSL-2.1","OSL-3.0","PADL","Parity-6.0.0","Parity-7.0.0","PDDL-1.0","PHP-3.0","PHP-3.01","Pixar","pkgconf","Plexus","pnmstitch","PolyForm-Noncommercial-1.0.0","PolyForm-Small-Business-1.0.0","PostgreSQL","PPL","PSF-2.0","psfrag","psutils","Python-2.0","Python-2.0.1","python-ldap","Qhull","QPL-1.0","QPL-1.0-INRIA-2004","radvd","Rdisc","RHeCos-1.1","RPL-1.1","RPL-1.5","RPSL-1.0","RSA-MD","RSCPL","Ruby","SAX-PD","SAX-PD-2.0","Saxpath","SCEA","SchemeReport","Sendmail","Sendmail-8.23","SGI-B-1.0","SGI-B-1.1","SGI-B-2.0","SGI-OpenGL","SGP4","SHL-0.5","SHL-0.51","SimPL-2.0","SISSL","SISSL-1.2","SL","Sleepycat","SMLNJ","SMPPL","SNIA","snprintf","softSurfer","Soundex","Spencer-86","Spencer-94","Spencer-99","SPL-1.0","ssh-keyscan","SSH-OpenSSH","SSH-short","SSLeay-standalone","SSPL-1.0","StandardML-NJ","SugarCRM-1.1.3","Sun-PPP","Sun-PPP-2000","SunPro","SWL","swrule","Symlinks","TAPR-OHL-1.0","TCL","TCP-wrappers","TermReadKey","TGPPL-1.0","threeparttable","TMate","TORQUE-1.1","TOSL","TPDL","TPL-1.0","TTWL","TTYP0","TU-Berlin-1.0","TU-Berlin-2.0","UCAR","UCL-1.0","ulem","UMich-Merit","Unicode-3.0","Unicode-DFS-2015","Unicode-DFS-2016","Unicode-TOU","UnixCrypt","Unlicense","UPL-1.0","URT-RLE","Vim","VOSTROM","VSL-1.0","W3C","W3C-19980720","W3C-20150513","w3m","Watcom-1.0","Widget-Workshop","Wsuipa","WTFPL","wxWindows","X11","X11-distribute-modifications-variant","Xdebug-1.03","Xerox","Xfig","XFree86-1.1","xinetd","xkeyboard-config-Zinoviev","xlock","Xnet","xpp","XSkat","xzoom","YPL-1.0","YPL-1.1","Zed","Zeeff","Zend-2.0","Zimbra-1.3","Zimbra-1.4","Zlib","zlib-acknowledgement","ZPL-1.1","ZPL-2.0","ZPL-2.1","389-exception","Asterisk-exception","Asterisk-linking-protocols-exception","Autoconf-exception-2.0","Autoconf-exception-3.0","Autoconf-exception-generic","Autoconf-exception-generic-3.0","Autoconf-exception-macro","Bison-exception-1.24","Bison-exception-2.2","Bootloader-exception","Classpath-exception-2.0","CLISP-exception-2.0","cryptsetup-OpenSSL-exception","DigiRule-FOSS-exception","eCos-exception-2.0","Fawkes-Runtime-exception","FLTK-exception","fmt-exception","Font-exception-2.0","freertos-exception-2.0","GCC-exception-2.0","GCC-exception-2.0-note","GCC-exception-3.1","Gmsh-exception","GNAT-exception","GNOME-examples-exception","GNU-compiler-exception","gnu-javamail-exception","GPL-3.0-interface-exception","GPL-3.0-linking-exception","GPL-3.0-linking-source-exception","GPL-CC-1.0","GStreamer-exception-2005","GStreamer-exception-2008","i2p-gpl-java-exception","KiCad-libraries-exception","LGPL-3.0-linking-exception","libpri-OpenH323-exception","Libtool-exception","Linux-syscall-note","LLGPL","LLVM-exception","LZMA-exception","mif-exception","Nokia-Qt-exception-1.1","OCaml-LGPL-linking-exception","OCCT-exception-1.0","OpenJDK-assembly-exception-1.0","openvpn-openssl-exception","PCRE2-exception","PS-or-PDF-font-exception-20170817","QPL-1.0-INRIA-2004-exception","Qt-GPL-exception-1.0","Qt-LGPL-exception-1.1","Qwt-exception-1.0","RRDtool-FLOSS-exception-2.0","SANE-exception","SHL-2.0","SHL-2.1","stunnel-exception","SWI-exception","Swift-exception","Texinfo-exception","u-boot-exception-2.0","UBDL-exception","Universal-FOSS-exception-1.0","vsftpd-openssl-exception","WxWindows-exception-3.1","x11vnc-openssl-exception"]}');
21
+ module.exports = /*#__PURE__*/JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://cyclonedx.org/schema/spdx.schema.json","$comment":"v1.0-3.26.0","type":"string","enum":["0BSD","3D-Slicer-1.0","AAL","Abstyles","AdaCore-doc","Adobe-2006","Adobe-Display-PostScript","Adobe-Glyph","Adobe-Utopia","ADSL","AFL-1.1","AFL-1.2","AFL-2.0","AFL-2.1","AFL-3.0","Afmparse","AGPL-1.0","AGPL-1.0-only","AGPL-1.0-or-later","AGPL-3.0","AGPL-3.0-only","AGPL-3.0-or-later","Aladdin","AMD-newlib","AMDPLPA","AML","AML-glslang","AMPAS","ANTLR-PD","ANTLR-PD-fallback","any-OSI","any-OSI-perl-modules","Apache-1.0","Apache-1.1","Apache-2.0","APAFML","APL-1.0","App-s2p","APSL-1.0","APSL-1.1","APSL-1.2","APSL-2.0","Arphic-1999","Artistic-1.0","Artistic-1.0-cl8","Artistic-1.0-Perl","Artistic-2.0","ASWF-Digital-Assets-1.0","ASWF-Digital-Assets-1.1","Baekmuk","Bahyph","Barr","bcrypt-Solar-Designer","Beerware","Bitstream-Charter","Bitstream-Vera","BitTorrent-1.0","BitTorrent-1.1","blessing","BlueOak-1.0.0","Boehm-GC","Boehm-GC-without-fee","Borceux","Brian-Gladman-2-Clause","Brian-Gladman-3-Clause","BSD-1-Clause","BSD-2-Clause","BSD-2-Clause-Darwin","BSD-2-Clause-first-lines","BSD-2-Clause-FreeBSD","BSD-2-Clause-NetBSD","BSD-2-Clause-Patent","BSD-2-Clause-Views","BSD-3-Clause","BSD-3-Clause-acpica","BSD-3-Clause-Attribution","BSD-3-Clause-Clear","BSD-3-Clause-flex","BSD-3-Clause-HP","BSD-3-Clause-LBNL","BSD-3-Clause-Modification","BSD-3-Clause-No-Military-License","BSD-3-Clause-No-Nuclear-License","BSD-3-Clause-No-Nuclear-License-2014","BSD-3-Clause-No-Nuclear-Warranty","BSD-3-Clause-Open-MPI","BSD-3-Clause-Sun","BSD-4-Clause","BSD-4-Clause-Shortened","BSD-4-Clause-UC","BSD-4.3RENO","BSD-4.3TAHOE","BSD-Advertising-Acknowledgement","BSD-Attribution-HPND-disclaimer","BSD-Inferno-Nettverk","BSD-Protection","BSD-Source-beginning-file","BSD-Source-Code","BSD-Systemics","BSD-Systemics-W3Works","BSL-1.0","BUSL-1.1","bzip2-1.0.5","bzip2-1.0.6","C-UDA-1.0","CAL-1.0","CAL-1.0-Combined-Work-Exception","Caldera","Caldera-no-preamble","Catharon","CATOSL-1.1","CC-BY-1.0","CC-BY-2.0","CC-BY-2.5","CC-BY-2.5-AU","CC-BY-3.0","CC-BY-3.0-AT","CC-BY-3.0-AU","CC-BY-3.0-DE","CC-BY-3.0-IGO","CC-BY-3.0-NL","CC-BY-3.0-US","CC-BY-4.0","CC-BY-NC-1.0","CC-BY-NC-2.0","CC-BY-NC-2.5","CC-BY-NC-3.0","CC-BY-NC-3.0-DE","CC-BY-NC-4.0","CC-BY-NC-ND-1.0","CC-BY-NC-ND-2.0","CC-BY-NC-ND-2.5","CC-BY-NC-ND-3.0","CC-BY-NC-ND-3.0-DE","CC-BY-NC-ND-3.0-IGO","CC-BY-NC-ND-4.0","CC-BY-NC-SA-1.0","CC-BY-NC-SA-2.0","CC-BY-NC-SA-2.0-DE","CC-BY-NC-SA-2.0-FR","CC-BY-NC-SA-2.0-UK","CC-BY-NC-SA-2.5","CC-BY-NC-SA-3.0","CC-BY-NC-SA-3.0-DE","CC-BY-NC-SA-3.0-IGO","CC-BY-NC-SA-4.0","CC-BY-ND-1.0","CC-BY-ND-2.0","CC-BY-ND-2.5","CC-BY-ND-3.0","CC-BY-ND-3.0-DE","CC-BY-ND-4.0","CC-BY-SA-1.0","CC-BY-SA-2.0","CC-BY-SA-2.0-UK","CC-BY-SA-2.1-JP","CC-BY-SA-2.5","CC-BY-SA-3.0","CC-BY-SA-3.0-AT","CC-BY-SA-3.0-DE","CC-BY-SA-3.0-IGO","CC-BY-SA-4.0","CC-PDDC","CC-PDM-1.0","CC-SA-1.0","CC0-1.0","CDDL-1.0","CDDL-1.1","CDL-1.0","CDLA-Permissive-1.0","CDLA-Permissive-2.0","CDLA-Sharing-1.0","CECILL-1.0","CECILL-1.1","CECILL-2.0","CECILL-2.1","CECILL-B","CECILL-C","CERN-OHL-1.1","CERN-OHL-1.2","CERN-OHL-P-2.0","CERN-OHL-S-2.0","CERN-OHL-W-2.0","CFITSIO","check-cvs","checkmk","ClArtistic","Clips","CMU-Mach","CMU-Mach-nodoc","CNRI-Jython","CNRI-Python","CNRI-Python-GPL-Compatible","COIL-1.0","Community-Spec-1.0","Condor-1.1","copyleft-next-0.3.0","copyleft-next-0.3.1","Cornell-Lossless-JPEG","CPAL-1.0","CPL-1.0","CPOL-1.02","Cronyx","Crossword","CrystalStacker","CUA-OPL-1.0","Cube","curl","cve-tou","D-FSL-1.0","DEC-3-Clause","diffmark","DL-DE-BY-2.0","DL-DE-ZERO-2.0","DOC","DocBook-Schema","DocBook-Stylesheet","DocBook-XML","Dotseqn","DRL-1.0","DRL-1.1","DSDP","dtoa","dvipdfm","ECL-1.0","ECL-2.0","eCos-2.0","EFL-1.0","EFL-2.0","eGenix","Elastic-2.0","Entessa","EPICS","EPL-1.0","EPL-2.0","ErlPL-1.1","etalab-2.0","EUDatagrid","EUPL-1.0","EUPL-1.1","EUPL-1.2","Eurosym","Fair","FBM","FDK-AAC","Ferguson-Twofish","Frameworx-1.0","FreeBSD-DOC","FreeImage","FSFAP","FSFAP-no-warranty-disclaimer","FSFUL","FSFULLR","FSFULLRWD","FTL","Furuseth","fwlw","GCR-docs","GD","generic-xts","GFDL-1.1","GFDL-1.1-invariants-only","GFDL-1.1-invariants-or-later","GFDL-1.1-no-invariants-only","GFDL-1.1-no-invariants-or-later","GFDL-1.1-only","GFDL-1.1-or-later","GFDL-1.2","GFDL-1.2-invariants-only","GFDL-1.2-invariants-or-later","GFDL-1.2-no-invariants-only","GFDL-1.2-no-invariants-or-later","GFDL-1.2-only","GFDL-1.2-or-later","GFDL-1.3","GFDL-1.3-invariants-only","GFDL-1.3-invariants-or-later","GFDL-1.3-no-invariants-only","GFDL-1.3-no-invariants-or-later","GFDL-1.3-only","GFDL-1.3-or-later","Giftware","GL2PS","Glide","Glulxe","GLWTPL","gnuplot","GPL-1.0","GPL-1.0+","GPL-1.0-only","GPL-1.0-or-later","GPL-2.0","GPL-2.0+","GPL-2.0-only","GPL-2.0-or-later","GPL-2.0-with-autoconf-exception","GPL-2.0-with-bison-exception","GPL-2.0-with-classpath-exception","GPL-2.0-with-font-exception","GPL-2.0-with-GCC-exception","GPL-3.0","GPL-3.0+","GPL-3.0-only","GPL-3.0-or-later","GPL-3.0-with-autoconf-exception","GPL-3.0-with-GCC-exception","Graphics-Gems","gSOAP-1.3b","gtkbook","Gutmann","HaskellReport","hdparm","HIDAPI","Hippocratic-2.1","HP-1986","HP-1989","HPND","HPND-DEC","HPND-doc","HPND-doc-sell","HPND-export-US","HPND-export-US-acknowledgement","HPND-export-US-modify","HPND-export2-US","HPND-Fenneberg-Livingston","HPND-INRIA-IMAG","HPND-Intel","HPND-Kevlin-Henney","HPND-Markus-Kuhn","HPND-merchantability-variant","HPND-MIT-disclaimer","HPND-Netrek","HPND-Pbmplus","HPND-sell-MIT-disclaimer-xserver","HPND-sell-regexpr","HPND-sell-variant","HPND-sell-variant-MIT-disclaimer","HPND-sell-variant-MIT-disclaimer-rev","HPND-UC","HPND-UC-export-US","HTMLTIDY","IBM-pibs","ICU","IEC-Code-Components-EULA","IJG","IJG-short","ImageMagick","iMatix","Imlib2","Info-ZIP","Inner-Net-2.0","InnoSetup","Intel","Intel-ACPI","Interbase-1.0","IPA","IPL-1.0","ISC","ISC-Veillard","Jam","JasPer-2.0","JPL-image","JPNIC","JSON","Kastrup","Kazlib","Knuth-CTAN","LAL-1.2","LAL-1.3","Latex2e","Latex2e-translated-notice","Leptonica","LGPL-2.0","LGPL-2.0+","LGPL-2.0-only","LGPL-2.0-or-later","LGPL-2.1","LGPL-2.1+","LGPL-2.1-only","LGPL-2.1-or-later","LGPL-3.0","LGPL-3.0+","LGPL-3.0-only","LGPL-3.0-or-later","LGPLLR","Libpng","libpng-2.0","libselinux-1.0","libtiff","libutil-David-Nugent","LiLiQ-P-1.1","LiLiQ-R-1.1","LiLiQ-Rplus-1.1","Linux-man-pages-1-para","Linux-man-pages-copyleft","Linux-man-pages-copyleft-2-para","Linux-man-pages-copyleft-var","Linux-OpenIB","LOOP","LPD-document","LPL-1.0","LPL-1.02","LPPL-1.0","LPPL-1.1","LPPL-1.2","LPPL-1.3a","LPPL-1.3c","lsof","Lucida-Bitmap-Fonts","LZMA-SDK-9.11-to-9.20","LZMA-SDK-9.22","Mackerras-3-Clause","Mackerras-3-Clause-acknowledgment","magaz","mailprio","MakeIndex","Martin-Birgmeier","McPhee-slideshow","metamail","Minpack","MIPS","MirOS","MIT","MIT-0","MIT-advertising","MIT-Click","MIT-CMU","MIT-enna","MIT-feh","MIT-Festival","MIT-Khronos-old","MIT-Modern-Variant","MIT-open-group","MIT-testregex","MIT-Wu","MITNFA","MMIXware","Motosoto","MPEG-SSG","mpi-permissive","mpich2","MPL-1.0","MPL-1.1","MPL-2.0","MPL-2.0-no-copyleft-exception","mplus","MS-LPL","MS-PL","MS-RL","MTLL","MulanPSL-1.0","MulanPSL-2.0","Multics","Mup","NAIST-2003","NASA-1.3","Naumen","NBPL-1.0","NCBI-PD","NCGL-UK-2.0","NCL","NCSA","Net-SNMP","NetCDF","Newsletr","NGPL","NICTA-1.0","NIST-PD","NIST-PD-fallback","NIST-Software","NLOD-1.0","NLOD-2.0","NLPL","Nokia","NOSL","Noweb","NPL-1.0","NPL-1.1","NPOSL-3.0","NRL","NTP","NTP-0","Nunit","O-UDA-1.0","OAR","OCCT-PL","OCLC-2.0","ODbL-1.0","ODC-By-1.0","OFFIS","OFL-1.0","OFL-1.0-no-RFN","OFL-1.0-RFN","OFL-1.1","OFL-1.1-no-RFN","OFL-1.1-RFN","OGC-1.0","OGDL-Taiwan-1.0","OGL-Canada-2.0","OGL-UK-1.0","OGL-UK-2.0","OGL-UK-3.0","OGTSL","OLDAP-1.1","OLDAP-1.2","OLDAP-1.3","OLDAP-1.4","OLDAP-2.0","OLDAP-2.0.1","OLDAP-2.1","OLDAP-2.2","OLDAP-2.2.1","OLDAP-2.2.2","OLDAP-2.3","OLDAP-2.4","OLDAP-2.5","OLDAP-2.6","OLDAP-2.7","OLDAP-2.8","OLFL-1.3","OML","OpenPBS-2.3","OpenSSL","OpenSSL-standalone","OpenVision","OPL-1.0","OPL-UK-3.0","OPUBL-1.0","OSET-PL-2.1","OSL-1.0","OSL-1.1","OSL-2.0","OSL-2.1","OSL-3.0","PADL","Parity-6.0.0","Parity-7.0.0","PDDL-1.0","PHP-3.0","PHP-3.01","Pixar","pkgconf","Plexus","pnmstitch","PolyForm-Noncommercial-1.0.0","PolyForm-Small-Business-1.0.0","PostgreSQL","PPL","PSF-2.0","psfrag","psutils","Python-2.0","Python-2.0.1","python-ldap","Qhull","QPL-1.0","QPL-1.0-INRIA-2004","radvd","Rdisc","RHeCos-1.1","RPL-1.1","RPL-1.5","RPSL-1.0","RSA-MD","RSCPL","Ruby","Ruby-pty","SAX-PD","SAX-PD-2.0","Saxpath","SCEA","SchemeReport","Sendmail","Sendmail-8.23","Sendmail-Open-Source-1.1","SGI-B-1.0","SGI-B-1.1","SGI-B-2.0","SGI-OpenGL","SGP4","SHL-0.5","SHL-0.51","SimPL-2.0","SISSL","SISSL-1.2","SL","Sleepycat","SMAIL-GPL","SMLNJ","SMPPL","SNIA","snprintf","softSurfer","Soundex","Spencer-86","Spencer-94","Spencer-99","SPL-1.0","ssh-keyscan","SSH-OpenSSH","SSH-short","SSLeay-standalone","SSPL-1.0","StandardML-NJ","SugarCRM-1.1.3","Sun-PPP","Sun-PPP-2000","SunPro","SWL","swrule","Symlinks","TAPR-OHL-1.0","TCL","TCP-wrappers","TermReadKey","TGPPL-1.0","ThirdEye","threeparttable","TMate","TORQUE-1.1","TOSL","TPDL","TPL-1.0","TrustedQSL","TTWL","TTYP0","TU-Berlin-1.0","TU-Berlin-2.0","Ubuntu-font-1.0","UCAR","UCL-1.0","ulem","UMich-Merit","Unicode-3.0","Unicode-DFS-2015","Unicode-DFS-2016","Unicode-TOU","UnixCrypt","Unlicense","UPL-1.0","URT-RLE","Vim","VOSTROM","VSL-1.0","W3C","W3C-19980720","W3C-20150513","w3m","Watcom-1.0","Widget-Workshop","Wsuipa","WTFPL","wwl","wxWindows","X11","X11-distribute-modifications-variant","X11-swapped","Xdebug-1.03","Xerox","Xfig","XFree86-1.1","xinetd","xkeyboard-config-Zinoviev","xlock","Xnet","xpp","XSkat","xzoom","YPL-1.0","YPL-1.1","Zed","Zeeff","Zend-2.0","Zimbra-1.3","Zimbra-1.4","Zlib","zlib-acknowledgement","ZPL-1.1","ZPL-2.0","ZPL-2.1","389-exception","Asterisk-exception","Asterisk-linking-protocols-exception","Autoconf-exception-2.0","Autoconf-exception-3.0","Autoconf-exception-generic","Autoconf-exception-generic-3.0","Autoconf-exception-macro","Bison-exception-1.24","Bison-exception-2.2","Bootloader-exception","CGAL-linking-exception","Classpath-exception-2.0","CLISP-exception-2.0","cryptsetup-OpenSSL-exception","DigiRule-FOSS-exception","eCos-exception-2.0","erlang-otp-linking-exception","Fawkes-Runtime-exception","FLTK-exception","fmt-exception","Font-exception-2.0","freertos-exception-2.0","GCC-exception-2.0","GCC-exception-2.0-note","GCC-exception-3.1","Gmsh-exception","GNAT-exception","GNOME-examples-exception","GNU-compiler-exception","gnu-javamail-exception","GPL-3.0-389-ds-base-exception","GPL-3.0-interface-exception","GPL-3.0-linking-exception","GPL-3.0-linking-source-exception","GPL-CC-1.0","GStreamer-exception-2005","GStreamer-exception-2008","harbour-exception","i2p-gpl-java-exception","Independent-modules-exception","KiCad-libraries-exception","LGPL-3.0-linking-exception","libpri-OpenH323-exception","Libtool-exception","Linux-syscall-note","LLGPL","LLVM-exception","LZMA-exception","mif-exception","mxml-exception","Nokia-Qt-exception-1.1","OCaml-LGPL-linking-exception","OCCT-exception-1.0","OpenJDK-assembly-exception-1.0","openvpn-openssl-exception","PCRE2-exception","PS-or-PDF-font-exception-20170817","QPL-1.0-INRIA-2004-exception","Qt-GPL-exception-1.0","Qt-LGPL-exception-1.1","Qwt-exception-1.0","romic-exception","RRDtool-FLOSS-exception-2.0","SANE-exception","SHL-2.0","SHL-2.1","stunnel-exception","SWI-exception","Swift-exception","Texinfo-exception","u-boot-exception-2.0","UBDL-exception","Universal-FOSS-exception-1.0","vsftpd-openssl-exception","WxWindows-exception-3.1","x11vnc-openssl-exception"]}');
22
22
 
23
23
  /***/ }),
24
24
 
@@ -1279,13 +1279,12 @@ var __importStar = (this && this.__importStar) || (function () {
1279
1279
  };
1280
1280
  })();
1281
1281
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1282
- exports.Utils = exports.Types = exports.Spec = exports.SPDX = exports.Models = exports.Enums = void 0;
1282
+ exports.Types = exports.Spec = exports.SPDX = exports.Models = exports.Enums = void 0;
1283
1283
  exports.Enums = __importStar(__webpack_require__(/*! ./enums */ "./src/enums/index.ts"));
1284
1284
  exports.Models = __importStar(__webpack_require__(/*! ./models */ "./src/models/index.ts"));
1285
1285
  exports.SPDX = __importStar(__webpack_require__(/*! ./spdx */ "./src/spdx.ts"));
1286
1286
  exports.Spec = __importStar(__webpack_require__(/*! ./spec */ "./src/spec/index.ts"));
1287
1287
  exports.Types = __importStar(__webpack_require__(/*! ./types */ "./src/types/index.ts"));
1288
- exports.Utils = __importStar(__webpack_require__(/*! ./utils */ "./src/utils/index.ts"));
1289
1288
 
1290
1289
 
1291
1290
  /***/ }),
@@ -1352,10 +1351,11 @@ var __importStar = (this && this.__importStar) || (function () {
1352
1351
  };
1353
1352
  })();
1354
1353
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1355
- exports.Validation = exports.Serialize = exports.Factories = void 0;
1354
+ exports.Validation = exports.Utils = exports.Serialize = exports.Factories = void 0;
1356
1355
  __exportStar(__webpack_require__(/*! ./index.common */ "./src/index.common.ts"), exports);
1357
1356
  exports.Factories = __importStar(__webpack_require__(/*! ./factories/index.web */ "./src/factories/index.web.ts"));
1358
1357
  exports.Serialize = __importStar(__webpack_require__(/*! ./serialize/index.web */ "./src/serialize/index.web.ts"));
1358
+ exports.Utils = __importStar(__webpack_require__(/*! ./utils/index.web */ "./src/utils/index.web.ts"));
1359
1359
  exports.Validation = __importStar(__webpack_require__(/*! ./validation/index.web */ "./src/validation/index.web.ts"));
1360
1360
 
1361
1361
 
@@ -6689,10 +6689,10 @@ function randomSerialNumber() {
6689
6689
 
6690
6690
  /***/ }),
6691
6691
 
6692
- /***/ "./src/utils/index.ts":
6693
- /*!****************************!*\
6694
- !*** ./src/utils/index.ts ***!
6695
- \****************************/
6692
+ /***/ "./src/utils/index.common.ts":
6693
+ /*!***********************************!*\
6694
+ !*** ./src/utils/index.common.ts ***!
6695
+ \***********************************/
6696
6696
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
6697
6697
 
6698
6698
 
@@ -6752,6 +6752,51 @@ exports.BomUtility = void 0;
6752
6752
  exports.BomUtility = __importStar(__webpack_require__(/*! ./bomUtility */ "./src/utils/bomUtility.ts"));
6753
6753
 
6754
6754
 
6755
+ /***/ }),
6756
+
6757
+ /***/ "./src/utils/index.web.ts":
6758
+ /*!********************************!*\
6759
+ !*** ./src/utils/index.web.ts ***!
6760
+ \********************************/
6761
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
6762
+
6763
+
6764
+ /*!
6765
+ This file is part of CycloneDX JavaScript Library.
6766
+
6767
+ Licensed under the Apache License, Version 2.0 (the "License");
6768
+ you may not use this file except in compliance with the License.
6769
+ You may obtain a copy of the License at
6770
+
6771
+ http://www.apache.org/licenses/LICENSE-2.0
6772
+
6773
+ Unless required by applicable law or agreed to in writing, software
6774
+ distributed under the License is distributed on an "AS IS" BASIS,
6775
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6776
+ See the License for the specific language governing permissions and
6777
+ limitations under the License.
6778
+
6779
+ SPDX-License-Identifier: Apache-2.0
6780
+ Copyright (c) OWASP Foundation. All Rights Reserved.
6781
+ */
6782
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6783
+ if (k2 === undefined) k2 = k;
6784
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6785
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6786
+ desc = { enumerable: true, get: function() { return m[k]; } };
6787
+ }
6788
+ Object.defineProperty(o, k2, desc);
6789
+ }) : (function(o, m, k, k2) {
6790
+ if (k2 === undefined) k2 = k;
6791
+ o[k2] = m[k];
6792
+ }));
6793
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
6794
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
6795
+ };
6796
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
6797
+ __exportStar(__webpack_require__(/*! ./index.common */ "./src/utils/index.common.ts"), exports);
6798
+
6799
+
6755
6800
  /***/ }),
6756
6801
 
6757
6802
  /***/ "./src/validation/errors.ts":