UNPKG

@hhgtech/hhg-components

Version:
24 lines (21 loc) 830 B
import './index-90813715.js'; import { L as LOCALE } from './Locale-f270bd9d.js'; // https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 const MAPPED_LOCALE = { [LOCALE.Vietnam]: 'VN', [LOCALE.Cambodia]: 'KH', [LOCALE.Indonesia]: 'ID', [LOCALE.Malaysia]: 'MY', [LOCALE.PhilippinesEnglish]: 'PH', [LOCALE.PhilippinesTagalog]: 'PH', [LOCALE.Taiwan]: 'TW', [LOCALE.Thailand]: 'TH', [LOCALE.Myanmar]: 'MM', }; const hiddenEmailChar = (str = '') => { const domainIndex = str.indexOf('@'); const leftSide = str.substring(0, domainIndex); const startMask = leftSide.length > 3 ? 3 : leftSide.length; return str.replace(str.substring(startMask, domainIndex), str.slice(startMask, domainIndex).replace(/./g, 'x')); }; export { MAPPED_LOCALE as M, hiddenEmailChar as h };