NineAI 2.4.2

This commit is contained in:
vastxie
2024-01-17 09:22:28 +08:00
commit bdc48207fc
636 changed files with 41864 additions and 0 deletions

16
dist/common/utils/maskEmail.js vendored Normal file
View File

@@ -0,0 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.maskEmail = void 0;
function maskEmail(email) {
if (!email)
return '';
const atIndex = email.indexOf('@');
if (atIndex <= 1) {
return email;
}
const firstPart = email.substring(0, atIndex - 1);
const lastPart = email.substring(atIndex);
const maskedPart = '*'.repeat(firstPart.length - 1);
return `${firstPart.charAt(0)}${maskedPart}${email.charAt(atIndex - 1)}${lastPart}`;
}
exports.maskEmail = maskEmail;