%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/emergentqj/actioncivile/pre-auth/.632e77b3fb93bc8da5b589b869bc0037/static/js/utils/
Upload File :
Create Path :
Current File : /home/emergentqj/actioncivile/pre-auth/.632e77b3fb93bc8da5b589b869bc0037/static/js/utils/fieldValidations.js

const minPasswordChars = 10;
const pattern = (pat) => (value) => (pat.test(value) ? undefined : "pattern");

export const emailPattern = pattern(
  /^(([^<>()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i,
);
export const maxLength = (max) => (value) => (value && value.length > max ? "max-length" : undefined);
export const maxPasswordLength45 = maxLength(45);
export const minLength = (min) => (value) => (value && value.length < min ? "min-length" : undefined);
export const minPasswordLength = (value) => (value && value.length < minPasswordChars ? { type: "Length", length: minPasswordChars } : undefined);
export const namePattern = pattern(/^[a-zA-Z\u00C0-\u017F\- ]+$/);
export const phonePattern = pattern(/^\+?[0-9]{3}-?[0-9]{4,12}$/);
export const required = (value) => (value ? undefined : "Required");
export const numbersOnlyPattern = pattern(/^\d*$/);

Zerion Mini Shell 1.0