style: code lint
This commit is contained in:
parent
0abc223283
commit
0ad1fd3c37
|
@ -19,7 +19,7 @@ const config = {
|
|||
offsetTernaryExpressions: true //三元表达式缩进
|
||||
}],
|
||||
quotes: ["error", "double"], // 引号
|
||||
"object-shorthand": ["error", "consistent"], // 对象字面量简写语法
|
||||
"object-shorthand": ["off", "consistent"], // 对象字面量简写语法
|
||||
|
||||
"no-unused-vars": "off", // 禁止未使用过的变量。已禁用,使用typescript检查
|
||||
"no-undef": "off", // 禁止未声明的变量。已禁用,使用typescript检查
|
||||
|
|
|
@ -18,7 +18,7 @@ export class SHA256Calculator {
|
|||
} else if (data instanceof Uint8Array) {
|
||||
newData = data
|
||||
} else {
|
||||
throw new Error("Data must be a string or ArrayBuffer")
|
||||
throw new Error("Data must be a string or Uint8Array")
|
||||
}
|
||||
const combinedData = new Uint8Array(this.digestBuffer.length + newData.length)
|
||||
combinedData.set(this.digestBuffer, 0)
|
||||
|
|
|
@ -36,7 +36,7 @@ interface UploaderWorkerConfig {
|
|||
}
|
||||
|
||||
/** 上传任务 */
|
||||
interface UploadTask {
|
||||
interface UploadTask {
|
||||
/** 任务ID */
|
||||
id: number
|
||||
/** 文件 */
|
||||
|
|
|
@ -219,7 +219,7 @@ function uploadChunkTask(taskId: any, { index, hash, blob }: FileChunk, onProgre
|
|||
})
|
||||
}
|
||||
|
||||
function checkMergeStatus(taskId) {
|
||||
function checkMergeStatus(taskId: number) {
|
||||
return new Promise<void>((resolve) => {
|
||||
// 轮询检查合并状态
|
||||
const f = async () => {
|
||||
|
@ -271,6 +271,7 @@ async function postData<T = any>(url: string, data: unknown) {
|
|||
function retry(f: Function, count: number) {
|
||||
let retryCount = 0
|
||||
return async (...args: any) => {
|
||||
// eslint-disable-next-line no-constant-condition
|
||||
while (true) {
|
||||
try {
|
||||
retryCount += 1
|
||||
|
|
Loading…
Reference in New Issue