max: function(def, value, key, errors) {
    const type = 'max'
    const sub = def.max
    if ((Array.isArray(value) || typeof value === 'string') && value.length > def.max) {
      errors.push({ type, sub, key, value, message: `Length must be less than or equal to ${def.max}` })