import {Validator} from './Validator'; import {ValidatorArray} from './ValidatorArray'; export class CountLessThanEqualsCheckedValidatorArray extends ValidatorArray { constructor(public count: number, value?: Validator[], target?: E, event?: Event, autoValid = true) { super(value, target, event, autoValid); } valid(): boolean { return (this.value ?? []).filter(it => it.checked).length <= this.count; } }