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

This commit is contained in:
Ryan McKinley 2020-09-29 10:39:52 -07:00 committed by GitHub
parent 71a01a1053
commit f60f1c3fc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View File

@ -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();

View File

@ -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] : []);