mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: use Array.isArray rather than lodash (#27898)
This commit is contained in:
parent
71a01a1053
commit
f60f1c3fc7
@ -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…
Reference in New Issue
Block a user