@towsila/expo-ui-library 1.5.11 → 1.5.12
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.
package/package.json
CHANGED
|
@@ -13,18 +13,12 @@ registerValidator("email", (value) => {
|
|
|
13
13
|
return "";
|
|
14
14
|
});
|
|
15
15
|
|
|
16
|
-
registerValidator("password", (value, field) => {
|
|
17
|
-
|
|
18
|
-
if (!value) return "Password is required";
|
|
19
|
-
if (value.length < min) return `Password must be at least ${min} characters`;
|
|
20
|
-
if (!/[!@#$%^&*(),.?":{}|<>]/.test(value)) return "Password must contain at least one special character";
|
|
21
|
-
return "";
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
registerValidator("confirmPassword", (value, _, formState) => {
|
|
25
|
-
if (!value) return "Please confirm your password";
|
|
16
|
+
registerValidator("password", (value, field, formState) => {
|
|
17
|
+
if (!value) return "Please enter a password";
|
|
26
18
|
if (value.length < 8) return "Password must be at least 8 characters";
|
|
27
|
-
|
|
19
|
+
if (field.name === "confirmPassword" && value !== formState["password"]) {
|
|
20
|
+
return "Passwords do not match";
|
|
21
|
+
}
|
|
28
22
|
return "";
|
|
29
23
|
});
|
|
30
24
|
|