UNPKG

devextreme

Version:

HTML5 JavaScript Component Suite for Responsive Web Development

30 lines (29 loc) 1.34 kB
/** * DevExtreme (esm/__internal/scheduler/utils/options_validator/common/validator_rules.js) * Version: 25.2.3 * Build date: Fri Dec 12 2025 * * Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/ */ import { createValidatorRule } from "../core/index"; import { divisibleBy, greaterThan, inRange, isInteger, lessThan } from "./validation_functions"; export const mustBeInteger = createValidatorRule("mustBeInteger", (value => isInteger(value))); export const mustBeGreaterThan = function(minimalValue) { let strict = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : true; return createValidatorRule("mustBeGreaterThan", (value => greaterThan(value, minimalValue, strict))) }; export const mustBeLessThan = function(maximalValue) { let strict = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : true; return createValidatorRule("mustBeLessThan", (value => lessThan(value, maximalValue, strict))) }; export const mustBeInRange = range => createValidatorRule("mustBeInRange", (value => inRange(value, range))); export const mustBeDivisibleBy = divider => createValidatorRule("mustBeDivisibleBy", (value => divisibleBy(value, divider)));