import { isLastValueTimerangeMode } from '../../helpers' ; import { dropLastBucket } from '../series/drop_last_bucket' ; import type { TableResponseProcessorsFunction } from './types' ; export const dropLastBucketFn = ( { response , panel , series } ) => ( next ) => ( results ) => { const shouldDropLastBucket = isLastValueTimerangeMode ( panel ) ; if ( shouldDropLastBucket ) { const fn = dropLastBucket ( response , panel , series ) ; return fn ( next ) ( results ) ; } return next ( results ) ; } ;