UNPKG

vue-vuelidate-jsonschema

Version:

Create validation definitions for vuelidate based on json schema

13 lines (11 loc) 304 B
var vuelidate = require('vuelidate') module.exports = function minItemsValidator(propertySchema, min) { return vuelidate.withParams({ type: 'schemaMinItems', schema: propertySchema, min: min }, function(val) { if (!Array.isArray(val)) return true return val.length >= min }) }