Lint pass.

This commit is contained in:
marko1616 2024-08-21 14:24:19 +08:00
parent deaa529c07
commit 89dd0773ee
3 changed files with 8 additions and 8 deletions

View file

@ -205,7 +205,7 @@ export class HTMLFileUpload extends FileUpload {
}
getRelativePath (): string {
return ""
return ''
}
getMode (): number {

View file

@ -48,7 +48,7 @@ export class ElectronPlatformService extends PlatformService {
})
}
async getAllFiles(dir: string) {
async getAllFiles (dir: string): string[] {
let files: string[] = []
const items = await fs.readdir(dir, { withFileTypes: true })
for (const item of items) {
@ -229,9 +229,9 @@ export class ElectronPlatformService extends PlatformService {
let allFiles: string[] = []
let relativePaths: string[] = []
for (const folderPath of paths) {
let files = await this.getAllFiles(folderPath)
const files = await this.getAllFiles(folderPath)
allFiles = allFiles.concat(files)
relativePaths = relativePaths.concat(files.map(file => path.posix.join(path.basename(folderPath),path.posix.relative(folderPath, file))))
relativePaths = relativePaths.concat(files.map(file => path.posix.join(path.basename(folderPath), path.posix.relative(folderPath, file))))
}
return Promise.all(allFiles.map(async (p, index) => {
@ -300,7 +300,7 @@ class ElectronFileUpload extends FileUpload {
private buffer: Buffer
private powerSaveBlocker = 0
constructor (private filePath: string, private electron: ElectronService, private relativePath: string="") {
constructor (private filePath: string, private electron: ElectronService, private relativePath = '') {
super()
this.buffer = Buffer.alloc(256 * 1024)
this.powerSaveBlocker = electron.powerSaveBlocker.start('prevent-app-suspension')
@ -316,7 +316,7 @@ class ElectronFileUpload extends FileUpload {
getName (): string {
return path.basename(this.filePath)
}
getRelativePath (): string {
return this.relativePath
}
@ -364,7 +364,7 @@ class ElectronFileDownload extends FileDownload {
}
getRelativePath (): string {
return ""
return ''
}
getMode (): number {

View file

@ -187,7 +187,7 @@ export class SFTPPanelComponent {
async uploadOneWithFolder (transfer: FileUpload): Promise<void> {
const savedPath = this.path
try {
await this.sftp.stat(path.join(this.path, transfer.getRelativePath()))
} catch (e) {