@saasmakers/ui 1.3.4 → 1.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -22,7 +22,7 @@ const validationMessage = computed(() => {
|
|
|
22
22
|
return unref(firstError.$message)
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
switch (
|
|
25
|
+
switch (true) {
|
|
26
26
|
case ruleIsInvalid(props.validation.alpha): {
|
|
27
27
|
return t('alpha')
|
|
28
28
|
}
|
|
@@ -107,14 +107,12 @@ const text = computed<BaseTextText>(() => {
|
|
|
107
107
|
})
|
|
108
108
|
|
|
109
109
|
function ruleIsInvalid(rule: unknown) {
|
|
110
|
-
if (rule === false) {
|
|
111
|
-
return
|
|
110
|
+
if (rule == null || rule === false) {
|
|
111
|
+
return false
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
if (
|
|
115
|
-
return (rule as {
|
|
116
|
-
$invalid: boolean
|
|
117
|
-
}).$invalid
|
|
114
|
+
if (typeof rule === 'object' && '$invalid' in rule) {
|
|
115
|
+
return (rule as { $invalid: boolean }).$invalid === true
|
|
118
116
|
}
|
|
119
117
|
|
|
120
118
|
return false
|