31 lines
951 B
TypeScript
31 lines
951 B
TypeScript
// Module ID: 6645
|
|
// Function ID: 6646
|
|
// Name: PhoneOrEmailUtils
|
|
// Dependencies: [2]
|
|
// Exports: getPhoneOrEmail, shouldShowCountryCodeSelector
|
|
|
|
// Module 6645 (PhoneOrEmailUtils)
|
|
import size from "module_2" /* 2 */;
|
|
|
|
const PhoneOrEmailSelectorForceMode = { PHONE: "phone", EMAIL: "email" };
|
|
const re1 = /^[-() \d]+$/;
|
|
const result = size.fileFinishedImporting("modules/phone/PhoneOrEmailUtils.tsx");
|
|
|
|
export { PhoneOrEmailSelectorForceMode };
|
|
export const shouldShowCountryCodeSelector = function shouldShowCountryCodeSelector(forceMode, cResult) {
|
|
let tmp2;
|
|
if (forceMode === obj.PHONE) {
|
|
tmp2 = !cResult.startsWith("+");
|
|
} else {
|
|
tmp2 = forceMode !== tmp.EMAIL;
|
|
if (tmp2) {
|
|
const isMatch = cResult.length >= 3 && re1.test(cResult);
|
|
tmp2 = isMatch;
|
|
}
|
|
}
|
|
return tmp2;
|
|
};
|
|
export const getPhoneOrEmail = function getPhoneOrEmail(arg0) {
|
|
const obj = /^\+\d/;
|
|
return obj.test(arg0) ? obj.PHONE : obj.EMAIL;
|
|
};
|