fix: lint
This commit is contained in:
@@ -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 文件对象
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
});
|
||||
// 更新目标对象值
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
/**
|
||||
* CRON 表达式工具类;提供 CRON 表达式的解析、格式化、验证等功能
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user