@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.
23 lines (22 loc) • 637 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.minLength = void 0;
const minLength = (value, options) => {
if (typeof options.value === "undefined") {
console.error('The "value" option must be specified for "minLength" validator.');
return true;
}
if (typeof value === "undefined" || value === null) {
return false;
}
if (value.constructor === Array) {
return value.length >= options.value;
}
if (typeof value === "object") {
return Object.keys(value).length >= options.value;
}
return String(value).length >= options.value;
};
exports.minLength = minLength;