Skip to content

Commit

Permalink
refactor(schema): order calling codes
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-gavanier committed Apr 16, 2024
1 parent 6ab7fea commit a367cc7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/models/contact/contact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const COURRIEL_REG_EXP: RegExp =
/^[a-zA-Z0-9_][a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])+$/u;

const TELEPHONE_REG_EXP: RegExp =
/^(?:(?:\+|00)(?:33|594|262|596|269|687|689|590|508|681)[\s.-]{0,3}(?:\(0\)[\s.-]{0,3})?|0)(?:(?:[1-9](?:[\s.-]?\d{2}){4}|\d{2}(?:[\s.-]\d{3}){2})|\d{6}|\s\d{3}(?:\s\d{2}){3})$/u;
/^(?:(?:\+|00)(?:33|262|269|508|590|594|596|681|687|689)[\s.-]{0,3}(?:\(0\)[\s.-]{0,3})?|0)(?:(?:[1-9](?:[\s.-]?\d{2}){4}|\d{2}(?:[\s.-]\d{3}){2})|\d{6}|\s\d{3}(?:\s\d{2}){3})$/u;

export const isValidCourriel = (courriel: string): boolean => COURRIEL_REG_EXP.test(courriel);

Expand Down

0 comments on commit a367cc7

Please sign in to comment.