UNPKG

vuelidate

Version:

Simple, lightweight model-based validation for Vue.js

12 lines (10 loc) 267 B
import { req, withParams } from './common' export default (min, max) => withParams( { type: 'between', min, max }, (value) => !req(value) || ((!/\s/.test(value) || value instanceof Date) && +min <= +value && +max >= +value) )