Fix financial taxonomy snapshot normalization
This commit is contained in:
@@ -312,12 +312,14 @@ function relativeDiff(left: number | null, right: number | null) {
|
||||
return Math.abs(left - right) / baseline;
|
||||
}
|
||||
|
||||
function periodStart(period: ResultPeriod) {
|
||||
return period.periodStart ?? period.period_start ?? null;
|
||||
function periodStart(period: ResultPeriod): string | null {
|
||||
const start = ('periodStart' in period ? period.periodStart : undefined) ?? period.period_start ?? null;
|
||||
return typeof start === 'string' ? start : null;
|
||||
}
|
||||
|
||||
function periodEnd(period: ResultPeriod) {
|
||||
return period.periodEnd ?? period.period_end ?? null;
|
||||
function periodEnd(period: ResultPeriod): string | null {
|
||||
const end = ('periodEnd' in period ? period.periodEnd : undefined) ?? period.period_end ?? null;
|
||||
return typeof end === 'string' ? end : null;
|
||||
}
|
||||
|
||||
function chooseDurationPeriodId(result: TaxonomyHydrationResult) {
|
||||
|
||||
Reference in New Issue
Block a user