@inkline/inkline
Version:
Inkline is the intuitive UI Components library that gives you a developer-friendly foundation for building high-quality, accessible, and customizable Vue.js 3 Design Systems.
21 lines (20 loc) • 550 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.max = void 0;
const max = (value, options) => {
if (typeof options.value === "undefined") {
console.error('The "value" option must be specified for "max" validator.');
return true;
}
if (typeof value === "undefined" || value === null) {
return false;
}
const process = v => Number(v);
if (Array.isArray(value)) {
return value.every(v => process(v) <= options.value);
}
return process(value) <= options.value;
};
exports.max = max;