Skip to content

Commit

Permalink
update runtime checks
Browse files Browse the repository at this point in the history
  • Loading branch information
maximpn committed Jul 25, 2024
1 parent ffa4678 commit 5a390a1
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ const visualizationResponseHasData = (response: VisualizationResponse[]): boolea
}
return Object.values<AggregationsTermsAggregateBase<unknown[]>>(
response[0].aggregations ?? {}
// @ts-expect-error upgrade typescript v5.1.6
).some(({ buckets }) => buckets.length > 0);
).some(
({ buckets }) => (Array.isArray(buckets) ? buckets.length : Object.keys(buckets).length) > 0
);
};

export const MatrixHistogramComponent: React.FC<MatrixHistogramComponentProps> = ({
Expand Down

0 comments on commit 5a390a1

Please sign in to comment.