import { IScript } from '@/domain/IScript' ; import { ICategory } from '@/domain/ICategory' ; import { IFilterResult } from './IFilterResult' ; export class FilterResult implements IFilterResult { constructor ( public readonly scriptMatches , public readonly categoryMatches , public readonly query ) { if ( ! query ) { throw new Error ( 'Query is empty or undefined' ) ; } if ( ! scriptMatches ) { throw new Error ( 'Script matches is undefined' ) ; } if ( ! categoryMatches ) { throw new Error ( 'Category matches is undefined' ) ; } } public hasAnyMatches ( ) { return this . scriptMatches . length > 0 || this . categoryMatches . length > 0 ; } }