mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-25 10:58:19 +01:00
Move left pane entirely to React
This commit is contained in:
@@ -36,3 +36,21 @@ export function parse(
|
||||
|
||||
return phoneNumber;
|
||||
}
|
||||
|
||||
export function normalize(
|
||||
phoneNumber: string,
|
||||
options: { regionCode: string }
|
||||
): string | undefined {
|
||||
const { regionCode } = options;
|
||||
try {
|
||||
const parsedNumber = instance.parse(phoneNumber, regionCode);
|
||||
|
||||
if (instance.isValidNumber(parsedNumber)) {
|
||||
return instance.format(parsedNumber, PhoneNumberFormat.E164);
|
||||
}
|
||||
|
||||
return;
|
||||
} catch (error) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user