Co-authored-by: Alex Ghiu <alex.ghiu@ing.com> Co-authored-by: Gerjan van Geest <Gerjan.van.Geest@ing.com> Co-authored-by: Thijs Louisse <Thijs.Louisse@ing.com> Co-authored-by: Joren Broekema <joren.broekema@ing.com> Co-authored-by: Erik Kroes <erik.kroes@ing.com>
18 lines
714 B
JavaScript
18 lines
714 B
JavaScript
import { Validator } from './Validator.js';
|
|
|
|
/**
|
|
* @desc Instead of evaluating the result of a regular validator, a ResultValidator looks
|
|
* at the total result of regular Validators. Instead of an execute function, it uses a
|
|
* 'executeOnResults' Validator.
|
|
* ResultValidators cannot be async, and should not contain an execute method.
|
|
*/
|
|
export class ResultValidator extends Validator {
|
|
/**
|
|
* @param {object} context
|
|
* @param {Validator[]} context.validationResult
|
|
* @param {Validator[]} context.prevValidationResult
|
|
* @param {Validator[]} context.validators
|
|
* @returns {Feedback[]}
|
|
*/
|
|
executeOnResults({ validationResult, prevValidationResult, validators }) {} // eslint-disable-line
|
|
}
|