lnked/react-starter

View on GitHub
src/helpers/utils/formated-phone.ts

Summary

Maintainability
A
0 mins
Test Coverage
export const formatedPhone = (phone: string): string =>
  phone && phone.replace(/\+/g, '').replace(/(\d)(\d{3})(\d{3})(\d{2})(\d{2})/, '+$1 ($2) $3-$4-$5')