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 79e0d3a commit 366364b
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 @@ -17,7 +17,7 @@ export type Contact = Model<
export type ContactToValidate = Omit<Contact, 'isContact'>;

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 isValidTelephone = (telephone: string): boolean => TELEPHONE_REG_EXP.test(telephone);

Expand Down

0 comments on commit 366364b

Please sign in to comment.