zhengyiming
1 天以前 78a9387cb4adcc585c81804d49f9161692d8904f
packages/utils/common.ts
@@ -133,5 +133,18 @@
export const hiddenIDNumberForEnd6 = (realIDNumber: string) => {
  if (!realIDNumber) return '';
  realIDNumber.replace(/^(\d+)(.{6})$/, '$1******');
  return realIDNumber.replace(/^(\d+)(.{6})$/, '$1******');
};
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, '');
}