From 293ff37ab5ac75a91b16fdac55f7cf7852b6ecab Mon Sep 17 00:00:00 2001 From: Fine Date: Wed, 10 Apr 2024 23:24:48 +0800 Subject: [PATCH] fix: types --- src/hooks/useExpressionsProcessor.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/hooks/useExpressionsProcessor.ts b/src/hooks/useExpressionsProcessor.ts index 11f57a95..60c66abe 100644 --- a/src/hooks/useExpressionsProcessor.ts +++ b/src/hooks/useExpressionsProcessor.ts @@ -119,7 +119,9 @@ export async function useExpressionsQueryProcessor(config: Indexable) { } else { for (const item of results) { const values = item.values.map((d: { value: unknown }) => d.value) || []; - const label = item.metric.labels.map((d: any) => `${d.key}=${d.value}`).join(","); + const label = item.metric.labels + .map((d: { key: string; value: string }) => `${d.key}=${d.value}`) + .join(","); source[label] = values; } @@ -127,7 +129,9 @@ export async function useExpressionsQueryProcessor(config: Indexable) { } if (type === ExpressionResultType.SINGLE_VALUE) { for (const item of results) { - const label = item.metric.labels.map((d: any) => `${d.key}=${d.value}`).join(","); + const label = item.metric.labels + .map((d: { key: string; value: string }) => `${d.key}=${d.value}`) + .join(","); const values = item.values.map((d: { value: unknown }) => d.value) || []; if (results.length === 1) { source[label || c.label || name] = values;