Skip to content

Commit

Permalink
Fix comments about GraphData
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickDeVries committed May 15, 2024
1 parent 5ffdf69 commit 3e47e88
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/hooks/UseGraph/Graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -612,10 +612,10 @@ export class Graph<TData, TDimensions extends number = 0> implements IGraph<TDat
): GraphDataAtCoordinates<TData, TDimensions, TCoordinates> => {
// special case for a 0 dimension graph or no coordinates
if (!coordinates?.length) {
// @ts-expect-error TData is valid as an GraphData with a TDimensions of 0
// @ts-expect-error TData is valid as a GraphData with a TDimensions of 0
return this.data
} else {
// @ts-expect-error TData is valid as an GraphData with a TDimensions of 0
// @ts-expect-error TData is valid as a GraphData with a TDimensions of 0
return coordinates.reduce((graph, coordinate) => graph?.[coordinate], this.data) ?? null
}
}
Expand Down Expand Up @@ -711,9 +711,9 @@ export class Graph<TData, TDimensions extends number = 0> implements IGraph<TDat

// special case for a 0 dimension graph or no coordinates
if (!coordinates?.length) {
// @ts-expect-error TData is valid as an GraphData with a TDimensions of 0
// @ts-expect-error TData is valid as a GraphData with a TDimensions of 0
this.data = value
// @ts-expect-error TData is valid as an GraphData with a TDimensions of 0
// @ts-expect-error TData is valid as a GraphData with a TDimensions of 0
return this.data
} else {
// @ts-expect-error the initial and final values of the reduce are different types but that is the intent
Expand Down

0 comments on commit 3e47e88

Please sign in to comment.