@cyclonedx/cyclonedx-library
Version:
Core functionality of CycloneDX for JavaScript (Node.js or WebBrowser).
128 lines (124 loc) • 4.97 kB
JavaScript
"use strict";
/*!
This file is part of CycloneDX JavaScript Library.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
SPDX-License-Identifier: Apache-2.0
Copyright (c) OWASP Foundation. All Rights Reserved.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports._Spec = void 0;
class _Spec {
#version;
#formats;
#componentTypes;
#hashAlgorithms;
#hashValuePattern;
#externalReferenceTypes;
#vulnerabilityRatingMethods;
#supportsDependencyGraph;
#supportsToolReferences;
#requiresComponentVersion;
#supportsProperties;
#supportsVulnerabilities;
#supportsComponentEvidence;
#supportsMetadataLifecycles;
#supportsMetadataLicenses;
#supportsMetadataProperties;
#supportsExternalReferenceHashes;
#supportsLicenseAcknowledgement;
#supportsServices;
#supportsToolsComponentsServices;
constructor(version, formats, componentTypes, hashAlgorithms, hashValuePattern, externalReferenceTypes, supportsDependencyGraph, supportsToolReferences, requiresComponentVersion, supportsProperties, supportsVulnerabilities, vulnerabilityRatingMethods, supportsComponentEvidence, supportsMetadataLifecycles, supportsMetadataLicenses, supportsMetadataProperties, supportsExternalReferenceHashes, supportsLicenseAcknowledgement, supportsServices, supportsToolsComponentsServices) {
this.#version = version;
this.#formats = new Set(formats);
this.#componentTypes = new Set(componentTypes);
this.#hashAlgorithms = new Set(hashAlgorithms);
this.#hashValuePattern = hashValuePattern;
this.#externalReferenceTypes = new Set(externalReferenceTypes);
this.#supportsDependencyGraph = supportsDependencyGraph;
this.#supportsToolReferences = supportsToolReferences;
this.#requiresComponentVersion = requiresComponentVersion;
this.#supportsProperties = supportsProperties;
this.#supportsVulnerabilities = supportsVulnerabilities;
this.#vulnerabilityRatingMethods = new Set(vulnerabilityRatingMethods);
this.#supportsComponentEvidence = supportsComponentEvidence;
this.#supportsMetadataLifecycles = supportsMetadataLifecycles;
this.#supportsMetadataLicenses = supportsMetadataLicenses;
this.#supportsMetadataProperties = supportsMetadataProperties;
this.#supportsExternalReferenceHashes = supportsExternalReferenceHashes;
this.#supportsLicenseAcknowledgement = supportsLicenseAcknowledgement;
this.#supportsServices = supportsServices;
this.#supportsToolsComponentsServices = supportsToolsComponentsServices;
}
get version() {
return this.#version;
}
supportsFormat(f) {
return this.#formats.has(f);
}
supportsComponentType(ct) {
return this.#componentTypes.has(ct);
}
supportsHashAlgorithm(ha) {
return this.#hashAlgorithms.has(ha);
}
supportsHashValue(hv) {
return typeof hv === 'string' &&
this.#hashValuePattern.test(hv);
}
supportsExternalReferenceType(ert) {
return this.#externalReferenceTypes.has(ert);
}
get supportsDependencyGraph() {
return this.#supportsDependencyGraph;
}
get supportsToolReferences() {
return this.#supportsToolReferences;
}
get requiresComponentVersion() {
return this.#requiresComponentVersion;
}
supportsProperties() {
return this.#supportsProperties;
}
get supportsVulnerabilities() {
return this.#supportsVulnerabilities;
}
supportsVulnerabilityRatingMethod(rm) {
return this.#vulnerabilityRatingMethods.has(rm);
}
get supportsComponentEvidence() {
return this.#supportsComponentEvidence;
}
get supportsMetadataLifecycles() {
return this.#supportsMetadataLifecycles;
}
get supportsMetadataLicenses() {
return this.#supportsMetadataLicenses;
}
get supportsMetadataProperties() {
return this.#supportsMetadataProperties;
}
get supportsExternalReferenceHashes() {
return this.#supportsExternalReferenceHashes;
}
get supportsLicenseAcknowledgement() {
return this.#supportsLicenseAcknowledgement;
}
get supportsServices() {
return this.#supportsServices;
}
get supportsToolsComponentsServices() {
return this.#supportsToolsComponentsServices;
}
}
exports._Spec = _Spec;
//# sourceMappingURL=_protocol.js.map