Fix TypeScript errors in financial validation
This commit is contained in:
@@ -536,9 +536,9 @@ Focus on finding these specific fields in the document. Extract exact values, nu
|
||||
const otherValues = otherPeriods
|
||||
.map(p => {
|
||||
const val = extractNumericValue(financials[p]!.revenue || '');
|
||||
return val !== null && val > 0 ? { period: p, value: val } : null;
|
||||
return val !== null && val > 0 ? { period: p as 'fy3' | 'fy2' | 'fy1' | 'ltm', value: val } : null;
|
||||
})
|
||||
.filter((v): v is { period: string; value: number } => v !== null);
|
||||
.filter((v): v is { period: 'fy3' | 'fy2' | 'fy1' | 'ltm'; value: number } => v !== null);
|
||||
|
||||
if (otherValues.length > 0) {
|
||||
const avgOtherValue = otherValues.reduce((a, b) => a + b.value, 0) / otherValues.length;
|
||||
|
||||
Reference in New Issue
Block a user