code: function maxlength (val, max) {
    if (typeof val === 'string') {
      return isInteger(max, 10) && val.length <= parseInt(max, 10)
    } else if (Array.isArray(val)) {
      return val.length <= parseInt(max, 10)
    } else {
      return false
    }
  }
docs: maxlength
  This function validate whether the maximum length.