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

32 lines
951 B
TypeScript
Raw Normal View History

2026-10-07 22:43:51 +00:00
// Module ID: 6451
// Function ID: 6452
// Name: PhoneOrEmailUtils
// Dependencies: [2]
// Exports: getPhoneOrEmail, shouldShowCountryCodeSelector
2026-10-07 22:43:51 +00:00
// Module 6451 (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 };
2026-10-02 13:37:24 +00:00
export const shouldShowCountryCodeSelector = function shouldShowCountryCodeSelector(forceMode, cResult) {
2026-10-01 14:13:23 +00:00
let tmp2;
if (forceMode === obj.PHONE) {
2026-10-02 13:37:24 +00:00
tmp2 = !cResult.startsWith("+");
} else {
tmp2 = forceMode !== tmp.EMAIL;
if (tmp2) {
2026-10-02 13:37:24 +00:00
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;
};