From 227c897ce512a7f1e6f3287ff6c8bcd54c893613 Mon Sep 17 00:00:00 2001 From: Gordon Smith Date: Fri, 26 Jan 2024 17:02:27 +0000 Subject: [PATCH] fix: grouped properties had "any" type. Signed-off-by: Gordon Smith --- packages/comms/src/ecl/workunit.ts | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/comms/src/ecl/workunit.ts b/packages/comms/src/ecl/workunit.ts index 3ff420b16c..ef1bfc76d1 100644 --- a/packages/comms/src/ecl/workunit.ts +++ b/packages/comms/src/ecl/workunit.ts @@ -29,25 +29,25 @@ const extendedProps = ["Avg", "Min", "Max", "Delta", "StdDev"]; const relatedProps = ["SkewMin", "SkewMax", "NodeMin", "NodeMax"]; interface PropertyValue { Key: string; - Value: string; + Value?: string; // Extended properties --- - Avg: string; - Min: string; - Max: string; - Delta: string; - StdDev: string; + Avg?: string; + Min?: string; + Max?: string; + Delta?: string; + StdDev?: string; // Related properties --- - SkewMin: string; - SkewMax: string; - NodeMin: string; - NodeMax: string; + SkewMin?: string; + SkewMax?: string; + NodeMin?: string; + NodeMax?: string; } export interface IScope { __parentName?: string; __children?: IScope[]; __formattedProps: { [key: string]: any }; - __groupedProps: { [key: string]: any }; + __groupedProps: { [key: string]: PropertyValue }; id: string; name: string; type: string; @@ -105,8 +105,8 @@ function splitLabel(key: string): SplitKey { return retVal; } -function formatValue(item: IScope, key: string): string { - return item.__formattedProps?.[key] ?? item[key] ?? ""; +function formatValue(item: IScope, key: string): string | undefined { + return item.__formattedProps?.[key] ?? item[key]; } type DedupProperties = { [key: string]: boolean };