/**
 * DevExtreme (cjs/__internal/scheduler/options_validator/core/options_validator.js)
 * Version: 23.2.6 (build 24140-0112)
 * Build date: Sun May 19 2024
 *
 * Copyright (c) 2012 - 2024 Developer Express Inc. ALL RIGHTS RESERVED
 * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
 */
"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
exports.OptionsValidator = void 0;
let OptionsValidator = function() {
    function OptionsValidator(validators) {
        this.validators = validators
    }
    var _proto = OptionsValidator.prototype;
    _proto.validate = function(options) {
        const errors = Object.entries(this.validators).reduce((result, _ref) => {
            let [validatorName, validator] = _ref;
            const validatorResult = validator.validate(options);
            if (true !== validatorResult) {
                result[validatorName] = validatorResult
            }
            return result
        }, {});
        return Object.keys(errors).length > 0 ? errors : true
    };
    return OptionsValidator
}();
exports.OptionsValidator = OptionsValidator;
