import { ExplorerState } from './reducers' ; import { OverallSwimlaneData , SwimlaneData } from './explorer_utils' ; interface HasMatchingPointsParams { filteredFields ? : ExplorerState [ 'filteredFields' ] ; swimlaneData : SwimlaneData | OverallSwimlaneData ; } export const hasMatchingPoints = ( { filteredFields = [ ] , swimlaneData , } ) : boolean => { const wildCardField = filteredFields . find ( ( field ) => /\@kuery-wildcard\@$/ . test ( field ) ) ; const substring = wildCardField !== undefined ? wildCardField . replace ( /\@kuery-wildcard\@$/ , '' ) : null ; return ( substring !== null && swimlaneData . points . some ( ( point ) => { return point . laneLabel . includes ( substring ) ; } ) ) ; } ;