Frontend/utils: Import has only from lodash (#17311)

This commit is contained in:
Šimon Podlipský 2019-05-28 10:17:03 +02:00 committed by Torkel Ödegaard
parent 83af1bdff3
commit 4b0ad174ff

View File

@ -1,4 +1,4 @@
import _ from 'lodash'; import { has } from 'lodash';
import { getValueFormat, getValueFormatterIndex, getValueFormats, stringToJsRegex } from '@grafana/ui'; import { getValueFormat, getValueFormatterIndex, getValueFormats, stringToJsRegex } from '@grafana/ui';
import deprecationWarning from '@grafana/ui/src/utils/deprecationWarning'; import deprecationWarning from '@grafana/ui/src/utils/deprecationWarning';
@ -193,7 +193,7 @@ kbn.calculateInterval = (range, resolution, lowLimitInterval) => {
kbn.describe_interval = str => { kbn.describe_interval = str => {
const matches = str.match(kbn.interval_regex); const matches = str.match(kbn.interval_regex);
if (!matches || !_.has(kbn.intervals_in_seconds, matches[2])) { if (!matches || !has(kbn.intervals_in_seconds, matches[2])) {
throw new Error('Invalid interval string, expecting a number followed by one of "Mwdhmsy"'); throw new Error('Invalid interval string, expecting a number followed by one of "Mwdhmsy"');
} else { } else {
return { return {