chore(web): new lint setup (#30020)

Co-authored-by: yyh <yuanyouhuilyz@gmail.com>
This commit is contained in:
Stephen Zhou
2025-12-23 16:58:55 +08:00
committed by GitHub
parent 9701a2994b
commit f2842da397
3356 changed files with 85046 additions and 81278 deletions

View File

@ -14,15 +14,15 @@
*/
export function encryptField(plaintext: string): string {
try {
// Base64 encode the plaintext
// btoa works with ASCII, so we need to handle UTF-8 properly
// Base64 encode the plaintext
// btoa works with ASCII, so we need to handle UTF-8 properly
const utf8Bytes = new TextEncoder().encode(plaintext)
const base64 = btoa(String.fromCharCode(...utf8Bytes))
return base64
}
catch (error) {
console.error('Field encoding failed:', error)
// If encoding fails, throw error to prevent sending plaintext
// If encoding fails, throw error to prevent sending plaintext
throw new Error('Encoding failed. Please check your input.')
}
}