grafana/public/app/core/utils/query.ts
2019-03-18 11:17:58 +01:00

13 lines
312 B
TypeScript

import _ from 'lodash';
import { DataQuery } from '@grafana/ui/';
export const getNextRefIdChar = (queries: DataQuery[]): string => {
const letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
return _.find(letters, refId => {
return _.every(queries, other => {
return other.refId !== refId;
});
});
};