Chore: use Array.isArray rather than lodash (#27898)

pull/27911/head
Ryan McKinley 5 years ago committed by GitHub
parent 71a01a1053
commit f60f1c3fc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      packages/grafana-data/src/dataframe/MutableDataFrame.ts
  2. 3
      packages/grafana-ui/src/components/StatsPicker/StatsPicker.tsx

@ -1,7 +1,6 @@
import { Field, DataFrame, DataFrameDTO, FieldDTO, FieldType } from '../types/dataFrame';
import { KeyValue, QueryResultMeta } from '../types/data';
import { guessFieldTypeFromValue, guessFieldTypeForField, toDataFrameDTO } from './processDataFrame';
import isArray from 'lodash/isArray';
import isString from 'lodash/isString';
import { makeFieldParser } from '../utils/fieldParser';
import { MutableVector, Vector } from '../types/vector';
@ -79,7 +78,7 @@ export class MutableDataFrame<T = any> extends FunctionalVector<T> implements Da
let buffer: any[] | undefined = undefined;
if (f.values) {
if (isArray(f.values)) {
if (Array.isArray(f.values)) {
buffer = f.values as any[];
} else {
buffer = (f.values as Vector).toArray();

@ -1,6 +1,5 @@
import React, { PureComponent } from 'react';
import isArray from 'lodash/isArray';
import difference from 'lodash/difference';
import { Select } from '../Select/Select';
@ -55,7 +54,7 @@ export class StatsPicker extends PureComponent<Props> {
onSelectionChange = (item: SelectableValue<string>) => {
const { onChange } = this.props;
if (isArray(item)) {
if (Array.isArray(item)) {
onChange(item.map(v => v.value));
} else {
onChange(item && item.value ? [item.value] : []);

Loading…
Cancel
Save