@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.
15 lines (14 loc) • 400 B
JavaScript
export const custom = async (value, options) => {
if (!options.validator) {
console.error("No `validator` function provided for custom validator.");
return true;
}
if (value?.constructor === Array) {
let valid = true;
for (const v of value) {
valid = valid && await options.validator(v, options);
}
return valid;
}
return options.validator(value, options);
};