|
1 | | -import { DownloadFlags, DownloadStatus, ProgressStatus } from "./progress-status-file.js"; |
2 | | -import { ChunkStatus, DownloadFile, SaveProgressInfo } from "../types.js"; |
| 1 | +import {DownloadFlags, DownloadStatus, ProgressStatus} from "./progress-status-file.js"; |
| 2 | +import {ChunkStatus, DownloadFile, SaveProgressInfo} from "../types.js"; |
3 | 3 | import BaseDownloadEngineFetchStream from "../streams/download-engine-fetch-stream/base-download-engine-fetch-stream.js"; |
4 | 4 | import BaseDownloadEngineWriteStream from "../streams/download-engine-write-stream/base-download-engine-write-stream.js"; |
5 | 5 | import retry from "async-retry"; |
6 | | -import { EventEmitter } from "eventemitter3"; |
7 | | -import switchProgram, { AvailablePrograms } from "./download-programs/switch-program.js"; |
| 6 | +import {EventEmitter} from "eventemitter3"; |
| 7 | +import switchProgram, {AvailablePrograms} from "./download-programs/switch-program.js"; |
8 | 8 | import BaseDownloadProgram from "./download-programs/base-download-program.js"; |
9 | | -import { pushComment } from "./utils/push-comment.js"; |
10 | | -import { uid } from "uid"; |
11 | | -import { DownloaderProgramManager } from "./downloaderProgramManager.js"; |
| 9 | +import {pushComment} from "./utils/push-comment.js"; |
| 10 | +import {uid} from "uid"; |
| 11 | +import {DownloaderProgramManager} from "./downloaderProgramManager.js"; |
12 | 12 |
|
13 | 13 | export type DownloadEngineFileOptions = { |
14 | 14 | chunkSize?: number; |
@@ -86,12 +86,12 @@ export default class DownloadEngineFile extends EventEmitter<DownloadEngineFileE |
86 | 86 | public constructor(file: DownloadFile, options: DownloadEngineFileOptions) { |
87 | 87 | super(); |
88 | 88 | this.file = file; |
89 | | - this.options = { ...DEFAULT_OPTIONS, ...options }; |
| 89 | + this.options = {...DEFAULT_OPTIONS, ...options}; |
90 | 90 | this._progressStatus = { |
91 | 91 | totalDownloadParts: file.parts.length, |
92 | 92 | fileName: file.localFileName, |
93 | 93 | transferAction: options.fetchStream.transferAction, |
94 | | - downloadFlags: this._createProgressFlags(), |
| 94 | + downloadFlags: this._createProgressFlags() |
95 | 95 | }; |
96 | 96 | this._setDefaultByOptions(); |
97 | 97 | this._initProgress(); |
@@ -288,7 +288,7 @@ export default class DownloadEngineFile extends EventEmitter<DownloadEngineFileE |
288 | 288 | } |
289 | 289 |
|
290 | 290 | protected async _downloadSlice(startChunk: number, endChunk: number) { |
291 | | - const getContext = () => this._activeStreamContext[startChunk] ??= { streamBytes: 0, retryingAttempts: 0 }; |
| 291 | + const getContext = () => this._activeStreamContext[startChunk] ??= {streamBytes: 0, retryingAttempts: 0}; |
292 | 292 |
|
293 | 293 | const fetchState = this.options.fetchStream.withSubState({ |
294 | 294 | chunkSize: this._progress.chunkSize, |
|
0 commit comments