export interface FilterValue { mode : 'retain' | 'exact' ; values : number [ ] ; } export function get ( value ? ) { const filter = { mode : 'retain' , values : [ ] , } ; if ( typeof value === 'string' && value . trim ( ) !== '' ) { if ( value . substring ( value . length - 1 ) === '!' ) { filter . mode = 'exact' ; value = value . substring ( 0 , value . length - 1 ) ; } value = value . replace ( /!/g , '' ) ; filter . values = value . split ( ',' ) . map ( ( item ) => Number ( item . trim ( ) ) ) ; } return filter ; }