Skip to content

Commit

Permalink
update findField fn
Browse files Browse the repository at this point in the history
  • Loading branch information
vitPinchuk committed Jul 12, 2024
1 parent 818f9e5 commit 62adfb0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/grafana-utils/src/utils/frame.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import { DataFrame, Field, FieldType } from '@grafana/data';
*/
export const findField = <TValue = unknown>(
series: DataFrame[],
predicateFn: (field: Field) => boolean
predicateFn: (field: Field, frame: DataFrame) => boolean
): Field<TValue> | undefined => {
for (let i = 0; i < series.length; i += 1) {
const frame = series[i];

const field = frame.fields.find((field) => predicateFn(field));
const field = frame.fields.find((field) => predicateFn(field, frame));

/**
* Field found
Expand Down

0 comments on commit 62adfb0

Please sign in to comment.