Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix TypeScript error by adding type guard for 'min' and 'max' properties
The TypeScript compiler was throwing errors because it couldn't find the properties 'min' and 'max' on the type 'BarReading'. The issue arises because TypeScript is unaware that 'min' and 'max' are only accessed when 'readings' is an array of 'LineReadings'. This commit adds a type guard to explicitly inform TypeScript about the type of 'reading', resolving the issue.
- Loading branch information