@@ -132,12 +132,12 @@ function parseMetricThreshold(raw) {
132132/**
133133 * Get the regression threshold for a specific metric.
134134 * Uses per-metric override from config if available, otherwise the global threshold.
135- * @param {ReturnType<typeof parseArgs> } opts
135+ * @param {{ threshold: number, metricThresholds?: Record<string, number | string> } } opts
136136 * @param {string } metric
137137 * @returns {MetricThreshold }
138138 */
139139function getMetricThreshold ( opts , metric ) {
140- const raw = opts . metricThresholds [ metric ] ;
140+ const raw = opts . metricThresholds ?. [ metric ] ;
141141 if ( raw !== undefined ) {
142142 return parseMetricThreshold ( raw ) ;
143143 }
@@ -748,7 +748,7 @@ function formatCompareLink(base, test) {
748748 *
749749 * @param {Record<string, any> } jsonReport
750750 * @param {Record<string, any> | null } baseline
751- * @param {{ threshold: number, metricThresholds: Record<string, number | string>, runs: number, baselineBuild?: string, build?: string } } opts
751+ * @param {{ threshold: number, metricThresholds? : Record<string, number | string>, runs: number, baselineBuild?: string, build?: string } } opts
752752 */
753753function generateCISummary ( jsonReport , baseline , opts ) {
754754 const baseLabel = opts . baselineBuild || 'baseline' ;
@@ -1354,7 +1354,7 @@ async function main() {
13541354/**
13551355 * Print baseline comparison and exit with code 1 if regressions found.
13561356 * @param {Record<string, any> } jsonReport
1357- * @param {{ baseline?: string, threshold: number, ci?: boolean, runs?: number, baselineBuild?: string, build?: string, resume?: string } } opts
1357+ * @param {{ baseline?: string, threshold: number, ci?: boolean, runs?: number, baselineBuild?: string, build?: string, resume?: string, metricThresholds?: Record<string, number | string> } } opts
13581358 */
13591359async function printComparison ( jsonReport , opts ) {
13601360 let regressionFound = false ;
0 commit comments