cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SingleValueData.value might be undefined

beigert
Participant

When you call 

```

const singleValue = convertToSingleValueData({
indexRange: [0, 0],
mappings: { x: { type: 'undefined', types: undefined } },
}, 0,{ x: undefined } "x", true);

if (single.value === undefined) // ESLint: Unnecessary conditional, the types have no overlap.(@typescript-eslint/no-unnecessary-condition)


Result of `convertToSingleValueData` looks like:

export interface SingleValueData {
/** The dimension identifier */
dimension: string;
/** The value for the dimension */
value: string | number;
/** The timeseries for the sparkline */
timeseries?: TimeseriesWithDimensions[];
}

value is typed as a string or number, however is not true, and it might be undefined as well.

1 REPLY 1

michalbrabec
Dynatrace Advocate
Dynatrace Advocate

Hello, thank you for pointing it out. We will check it and fix it. 

Featured Posts