decord/alpha/source/modules/phone/PhoneOrEmailUtils.tsx

32 lines
951 B
TypeScript
Raw Normal View History

2026-10-09 10:00:15 +00:00
// Module ID: 6643
// Function ID: 6644
// Name: PhoneOrEmailUtils
2026-07-23 10:11:24 +00:00
// Dependencies: [2]
2026-07-20 16:05:17 +00:00
// Exports: getPhoneOrEmail, shouldShowCountryCodeSelector
2026-10-09 10:00:15 +00:00
// Module 6643 (PhoneOrEmailUtils)
import size from "module_2" /* 2 */;
2026-08-24 06:08:38 +00:00
const PhoneOrEmailSelectorForceMode = { PHONE: "phone", EMAIL: "email" };
2026-07-23 10:11:24 +00:00
const re1 = /^[-() \d]+$/;
const result = size.fileFinishedImporting("modules/phone/PhoneOrEmailUtils.tsx");
2026-07-20 16:05:17 +00:00
export { PhoneOrEmailSelectorForceMode };
2026-10-03 08:58:59 +00:00
export const shouldShowCountryCodeSelector = function shouldShowCountryCodeSelector(forceMode, cResult) {
let tmp2;
2026-07-20 16:05:17 +00:00
if (forceMode === obj.PHONE) {
2026-10-03 08:58:59 +00:00
tmp2 = !cResult.startsWith("+");
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
tmp2 = forceMode !== tmp.EMAIL;
2026-07-20 16:05:17 +00:00
if (tmp2) {
2026-10-03 08:58:59 +00:00
const isMatch = cResult.length >= 3 && re1.test(cResult);
2026-07-20 16:05:17 +00:00
tmp2 = isMatch;
}
}
return tmp2;
};
export const getPhoneOrEmail = function getPhoneOrEmail(arg0) {
const obj = /^\+\d/;
2026-07-20 16:05:17 +00:00
return obj.test(arg0) ? obj.PHONE : obj.EMAIL;
};