Skip to content

Commit

Permalink
Add support for both facebook and messenger
Browse files Browse the repository at this point in the history
  • Loading branch information
mythilytm committed Oct 24, 2024
1 parent 9fc0048 commit 7ccc8a2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion functions/getProfileFlagsForIdentifier.protected.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,12 @@ const trimHyphens = (s: string) => s.replaceAll('-', '');
const phoneNumberStandardization = (s: string) =>
[trimSpaces, trimHyphens].reduce((accum, f) => f(accum), s);
type TransformIdentifierFunction = (c: string) => string;
const channelTransformations: { [k in string]: TransformIdentifierFunction[] } = {
const channelTransformations: { [k: string]: TransformIdentifierFunction[] } = {
voice: [phoneNumberStandardization],
sms: [phoneNumberStandardization],
whatsapp: [(s) => s.replace('whatsapp:', ''), phoneNumberStandardization],
modica: [(s) => s.replace('modica:', ''), phoneNumberStandardization],
facebook: [(s) => s.replace('messenger:', '')],
messenger: [(s) => s.replace('messenger:', '')],
instagram: [],
line: [],
Expand Down

0 comments on commit 7ccc8a2

Please sign in to comment.