wupengfei
2025-09-26 e2b05af68baf459155ffd5c08e3d6eaa21136001
packages/utils/common.ts
@@ -136,7 +136,20 @@
  return realIDNumber.replace(/^(\d+)(.{6})$/, '$1******');
};
export const showBankCodeForEnd4 = (bankCode: string) => {
  if (!bankCode) return '';
  return '*'.repeat(Math.max(0, bankCode.length - 4)) + bankCode.slice(-4);
};
export const hiddenPhone = (phone: string) => {
  if (!phone) return '';
  return phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
};
export function filterCN(str: string) {
  return str.replace(/[\u4e00-\u9fa5]/gi, '');
}
export function filterNotCN(str: string) {
  return str.replace(/[^\u4e00-\u9fa5]/gi, '');
}