UNPKG

dom-validator

Version:

Validator similar to vee-validator for vuetify Applications

18 lines (14 loc) 400 B
export default (value, params = [false]) => { if (Array.isArray(value)) { return !! value.length; } // incase a field considers `false` as an empty value like checkboxes. const invalidateFalse = params[0]; if (value === false && invalidateFalse) { return false; } if (value === undefined || value === null) { return false; } return !! String(value).trim().length; };