gkucmierz/social-links

Phone Number Services?

Opened this issue · 0 comments

Services like WhatsApp are a bit trickier I think because you need to do some validation on phone numbers (non trivial). I'm wondering if there would interest to allowing a profile to not only accept ProfileMatch[] configurations, but to also accept something like ProfilerMatcher which would contain functions which return the profile id, instead of regex expressions. This would allow for parsing and validating phone numbers, which is not feasible using regex.

export interface ProfileMatcher {
  /** Takes user input and returns profileId **/
  match: (input: string) => string;  
  /** Pattern to craft URL **/
  pattern?: string;
  /** Desktop or Mobile**/
  type?: number;  
}