decord/beta/source/modules/phone/PhoneOrEmailUtils.tsx
github-actions 30c0bb2ec3 chore: update source for beta 347.10
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4975.js (118.4 MB)
2026-09-24 16:03:38 +00:00

33 lines
986 B
TypeScript

// Module ID: 7236
// Function ID: 7237
// Name: PhoneOrEmailUtils
// Dependencies: [2]
// Exports: getPhoneOrEmail, shouldShowCountryCodeSelector
// Module 7236 (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) {
if (forceMode === obj.PHONE) {
let tmp2 = !cResult.startsWith("+");
} else {
tmp2 = forceMode !== tmp.EMAIL;
if (tmp2) {
let isMatch = cResult.length >= 3;
if (isMatch) {
isMatch = re1.test(cResult);
}
tmp2 = isMatch;
}
}
return tmp2;
};
export const getPhoneOrEmail = function getPhoneOrEmail(arg0) {
const obj = /^\+\d/;
return obj.test(arg0) ? obj.PHONE : obj.EMAIL;
};