UNPKG

vue-vuelidate-jsonschema

Version:

Create validation definitions for vuelidate based on json schema

14 lines (12 loc) 345 B
var vuelidate = require('vuelidate') var isFinite = require('lodash/isFinite') module.exports = function exclusiveMaxValidator(propertySchema, max) { return vuelidate.withParams({ type: 'schemaExclusiveMaximum', max: max, schema: propertySchema }, function(val) { if (!isFinite(val)) return true return val < max }) }