@hhgtech/hhg-components
Version:
Hello Health Group common components
27 lines (23 loc) • 933 B
JavaScript
;
require('./index-ad7155cf.js');
var Locale = require('./Locale-59ccf941.js');
// https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
const MAPPED_LOCALE = {
[Locale.LOCALE.Vietnam]: 'VN',
[Locale.LOCALE.Cambodia]: 'KH',
[Locale.LOCALE.Indonesia]: 'ID',
[Locale.LOCALE.Malaysia]: 'MY',
[Locale.LOCALE.PhilippinesEnglish]: 'PH',
[Locale.LOCALE.PhilippinesTagalog]: 'PH',
[Locale.LOCALE.Taiwan]: 'TW',
[Locale.LOCALE.Thailand]: 'TH',
[Locale.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'));
};
exports.MAPPED_LOCALE = MAPPED_LOCALE;
exports.hiddenEmailChar = hiddenEmailChar;