import { isArray , last , isEqual } from 'lodash' ; import type { PanelDataArray } from './types/vis_data' ; export const EMPTY_VALUE = null ; export const DISPLAY_EMPTY_VALUE = '-' ; const extractValue = ( data ) => ( data && data [ 1 ] ) ?? EMPTY_VALUE ; export const getLastValue = ( data ) => { if ( ! isArray ( data ) ) { return data ; } return extractValue ( last ( data ) ! ) ; } ; export const isEmptyValue = ( value ) => isEqual ( value , EMPTY_VALUE ) ;