Skip to content

Commit

Permalink
Fix type mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisCrossCrash committed Dec 9, 2024
1 parent 73bc7bc commit ec6214a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,12 @@ export function setDatasets<
const addedDatasets: ChartDataset<TType, TData>[] = []

currentData.datasets = nextDatasets.map(
(nextDataset: Record<string, unknown>): ChartDataset<TType, TData> => {
(nextDataset: ChartDataset<TType, TData>): ChartDataset<TType, TData> => {
// given the new set, find it's current match
const currentDataset = currentData.datasets.find(
(dataset: Record<string, unknown>) =>
dataset[datasetIdKey] === nextDataset[datasetIdKey],
(dataset: ChartDataset<TType, TData>) =>
dataset[datasetIdKey as keyof ChartDataset<TType, TData>] ===
nextDataset[datasetIdKey as keyof ChartDataset<TType, TData>],
)

// There is no original to update, so simply add new one
Expand Down

0 comments on commit ec6214a

Please sign in to comment.