decord/stable/source/modules/phone/PhoneOrEmailUtils.tsx
github-actions 528a3dd5ba chore: update source for stable 345.9
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4745.js (118.4 MB)
2026-09-18 20:18:48 +00:00

33 lines
978 B
TypeScript

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