fix: lint

This commit is contained in:
xingyu4j
2026-06-26 19:41:59 +08:00
parent 25be0950c7
commit 3d92c784c3
66 changed files with 147 additions and 129 deletions

View File

@@ -142,15 +142,12 @@ export function dataURLtoBlob(base64Buf: string): Blob {
const arr = base64Buf.split(',');
const typeItem = arr[0];
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const mime = typeItem!.match(/:(.*?);/)![1];
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const bstr = window.atob(arr[1]!);
let n = bstr.length;
const u8arr = new Uint8Array(n);
while (n--) {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
u8arr[n] = bstr.codePointAt(n)!;
}
return new Blob([u8arr], { type: mime });
@@ -225,8 +222,7 @@ export function base64ToFile(base64: string, fileName: string): File {
// 优化的 Uint8Array 填充逻辑
for (let i = 0; i < n; i++) {
// 使用 charCodeAt() 获取字符对应的字节值Base64 解码后的字符串是字节级别的)
// eslint-disable-next-line unicorn/prefer-code-point
u8arr[i] = bstr.charCodeAt(i);
u8arr[i] = bstr.codePointAt(i);
}
// 返回 File 文件对象

View File

@@ -82,8 +82,7 @@ export function copyValueToTarget(target: any, source: any) {
Object.keys(newObj).forEach((key) => {
// 如果不是target中的属性则删除
if (!Object.keys(target).includes(key)) {
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
delete newObj[key];
delete newObj.key;
}
});
// 更新目标对象值

View File

@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */
/**
* CRON 表达式工具类;提供 CRON 表达式的解析、格式化、验证等功能
*/