ottoman
Version:
Ottoman Couchbase ODM
28 lines • 956 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateMaxLimit = exports.validateMinLimit = void 0;
const validateMinLimit = (val, min, property) => {
if (typeof min === 'number' && min > val) {
return `Property '${property}' is less than the minimum allowed value of '${min}'`;
}
if (typeof min !== 'undefined') {
const _obj = min;
if (_obj.val > val) {
return _obj.message;
}
}
};
exports.validateMinLimit = validateMinLimit;
const validateMaxLimit = (val, max, property) => {
if (typeof max === 'number' && max < val) {
return `Property '${property}' is more than the maximum allowed value of '${max}'`;
}
if (typeof max !== 'undefined') {
const _obj = max;
if (_obj.val < val) {
return _obj.message;
}
}
};
exports.validateMaxLimit = validateMaxLimit;
//# sourceMappingURL=number-minmax.js.map