mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-25 01:09:26 +00:00
fix: resolve lint, typecheck, and tsconfig deprecation errors
This commit is contained in:
@@ -316,7 +316,7 @@ export class LocalStorageService implements S3Service {
|
||||
return stats.size
|
||||
} catch (e: unknown) {
|
||||
if (e instanceof Error && (e as NodeJS.ErrnoException).code === 'ENOENT') {
|
||||
throw new Error(`NoSuchKey: The specified key does not exist.`)
|
||||
throw new Error(`NoSuchKey: The specified key does not exist.`, { cause: e })
|
||||
}
|
||||
throw e
|
||||
}
|
||||
@@ -347,7 +347,7 @@ export class LocalStorageService implements S3Service {
|
||||
}
|
||||
} catch (e: unknown) {
|
||||
if (e instanceof Error && (e as NodeJS.ErrnoException).code === 'ENOENT') {
|
||||
throw new Error(`NoSuchKey: The specified key does not exist.`)
|
||||
throw new Error(`NoSuchKey: The specified key does not exist.`, { cause: e })
|
||||
}
|
||||
throw e
|
||||
}
|
||||
@@ -424,7 +424,7 @@ export class LocalStorageService implements S3Service {
|
||||
}
|
||||
} catch (e: unknown) {
|
||||
if (e instanceof Error && (e as NodeJS.ErrnoException).code === 'ENOENT') {
|
||||
throw new Error(`NoSuchKey: The specified key does not exist.`)
|
||||
throw new Error(`NoSuchKey: The specified key does not exist.`, { cause: e })
|
||||
}
|
||||
throw e
|
||||
}
|
||||
|
||||
@@ -16,13 +16,10 @@ export class SearchService {
|
||||
) {}
|
||||
|
||||
async search(folderId: string, req: SearchRequest): Promise<PaginatedData<AssetInfo[]>> {
|
||||
let targetFolderIds: string[] = []
|
||||
|
||||
if (req.recursively === false) {
|
||||
targetFolderIds = [folderId]
|
||||
} else {
|
||||
targetFolderIds = await this.assetSvc.getDescendantFolderIds(folderId)
|
||||
}
|
||||
const targetFolderIds =
|
||||
req.recursively === false
|
||||
? [folderId]
|
||||
: await this.assetSvc.getDescendantFolderIds(folderId)
|
||||
|
||||
const targetTypes =
|
||||
req.assetType === 'folder' ? [AssetType.folder] : [AssetType.file, AssetType.version_stack]
|
||||
|
||||
@@ -30,12 +30,8 @@ export class UploadService {
|
||||
req: CreateUploadTaskRequest,
|
||||
): Promise<CreateUploadTaskResponse> {
|
||||
const visibleFiles = req.files.filter((f) => !f.name.startsWith('.'))
|
||||
let taskName = ''
|
||||
if (visibleFiles.length === 1) {
|
||||
taskName = visibleFiles[0].name
|
||||
} else {
|
||||
taskName = `${visibleFiles.length} Items`
|
||||
}
|
||||
const taskName =
|
||||
visibleFiles.length === 1 ? visibleFiles[0].name : `${visibleFiles.length} Items`
|
||||
|
||||
let total = 0
|
||||
const countTotalFiles = (nodes: FileNode[]) => {
|
||||
|
||||
Reference in New Issue
Block a user