import { Filter , LogicalFilterOR , LogicalFilterAND } from '../types/filter' ; export function mergeFilters ( filterA , filterB , strategy = 'and' ) { if ( ! filterA ) return filterB ; if ( ! filterB ) return filterA ; return { [ `_${ strategy }` ] : [ filterA , filterB ] , } as LogicalFilterAND | LogicalFilterOR ; }