UNPKG

@rohit_coder/cvss

Version:

The Common Vulnerability Scoring System ([CVSS](https://www.first.org/cvss/)) [base](https://www.first.org/cvss/specification-document#Base-Metrics) [score](https://www.first.org/cvss/specification-document#1-2-Scoring) calculator and validator library wr

26 lines (25 loc) 973 B
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 {};