cvss4
Version:
The **Common Vulnerability Scoring System (CVSS)** is a [scoring framework](https://www.first.org/cvss/) that provides numerical scores to assess the severity of software vulnerabilities. This TypeScript-based library offers support for CVSS versions **3.
26 lines (25 loc) • 973 B
TypeScript
import { Metric, MetricValue } from './models';
/**
* Validates a CVSS vector string according to expected metrics and mandatory requirements.
* @param {string} vectorString - The CVSS vector string to validate.
* @returns {{ valid: boolean, error?: string, selectedMetrics?: Record<string, string> }}
* Returns an object indicating whether the vector is valid, with an error message if invalid.
*/
export declare const validateVectorV4: (vectorString: string | null) => {
valid: boolean;
error?: string;
selectedMetrics?: Record<string, string>;
};
export declare const validateVersion: (versionStr: string | null) => void;
declare type ValidationResult = {
isTemporal: boolean;
isEnvironmental: boolean;
metricsMap: Map<Metric, MetricValue>;
versionStr: string | null;
};
/**
* Validate that the given string is a valid cvss vector
* @param cvssStr
*/
export declare const validate: (cvssStr: string) => ValidationResult;
export {};