@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.
13 lines (12 loc) • 316 B
JavaScript
export const required = (value, options) => {
if (value === void 0 || value === null) {
return false;
}
if (value.constructor === Array) {
return !!value.length;
}
if (typeof value === "boolean") {
return options.invalidateFalse ? !!value : true;
}
return !!String(value).trim().length;
};