All files / src/validator date.js

75% Statements 3/4
66.67% Branches 2/3
100% Functions 1/1
75% Lines 3/4
1 2 3 4 5 6 7 8 9      3x 3x     3x  
import { formatDate, parse } from '../utils.js'
 
export default (value, format = 'YYYY-MM-DD') => {
  const _value = parse(value, format, new Date())
  Iif (value !== formatDate(_value, format)) {
    return false
  }
  return true
}