11import prettyMillisecondsCompact from "../../../transfer-visualize/utils/prettyMSFast.js" ;
2- import { promiseWithResolvers } from "../../utils/promiseWithResolvers.js" ;
2+ import { promiseWithResolvers } from "../../utils/promiseWithResolvers.js" ;
33import BaseDownloadEngineFetchStream , {
44 DownloadInfoResponse ,
55 FetchSubState ,
66 MIN_LENGTH_FOR_MORE_INFO_REQUEST ,
77 WriteCallback
88} from "./base-download-engine-fetch-stream.js" ;
9- import { EmptyStreamTimeoutError } from "./errors/EmptyStreamTimeoutError.js" ;
9+ import { EmptyStreamTimeoutError } from "./errors/EmptyStreamTimeoutError.js" ;
1010import InvalidContentLengthError from "./errors/invalid-content-length-error.js" ;
1111import StatusCodeError from "./errors/status-code-error.js" ;
12- import { browserCheck } from "./utils/browserCheck.js" ;
13- import { parseContentDisposition } from "./utils/content-disposition.js" ;
14- import { parseHttpContentRange } from "./utils/httpRange.js" ;
12+ import { browserCheck } from "./utils/browserCheck.js" ;
13+ import { parseContentDisposition } from "./utils/content-disposition.js" ;
14+ import { parseHttpContentRange } from "./utils/httpRange.js" ;
1515import SmartChunkSplit from "./utils/smart-chunk-split.js" ;
1616
1717type GetNextChunk = ( ) => Promise < ReadableStreamReadResult < Uint8Array > > | ReadableStreamReadResult < Uint8Array > ;
@@ -41,8 +41,8 @@ export default class DownloadEngineFetchStreamFetch extends BaseDownloadEngineFe
4141 this . _activeController ?. abort ( ) ;
4242 }
4343
44- const { signal, abort, clearAbortTimeout } = DownloadEngineFetchStreamFetch . timeoutAbortController ( this . options . headersTimeout ! ) ;
45- this . _activeController = { abort, signal } ;
44+ const { signal, abort, clearAbortTimeout} = DownloadEngineFetchStreamFetch . timeoutAbortController ( this . options . headersTimeout ! ) ;
45+ this . _activeController = { abort, signal} ;
4646 this . on ( "aborted" , abort ) ;
4747
4848 try {
@@ -86,7 +86,7 @@ export default class DownloadEngineFetchStreamFetch extends BaseDownloadEngineFe
8686 }
8787
8888 protected async fetchDownloadInfoWithoutRetryByMethod ( url : string , method : "HEAD" | "GET" = "HEAD" ) : Promise < DownloadInfoResponse > {
89- const { signal, abort, clearAbortTimeout } = DownloadEngineFetchStreamFetch . timeoutAbortController ( this . options . headersTimeout ! ) ;
89+ const { signal, abort, clearAbortTimeout} = DownloadEngineFetchStreamFetch . timeoutAbortController ( this . options . headersTimeout ! ) ;
9090
9191 try {
9292 const response = await fetch ( url , {
@@ -140,7 +140,7 @@ export default class DownloadEngineFetchStreamFetch extends BaseDownloadEngineFe
140140 }
141141
142142 chunkGenerator ( callback : WriteCallback , getNextChunk : GetNextChunk ) {
143- const { promise, reject, resolve } = promiseWithResolvers < void > ( ) ;
143+ const { promise, reject, resolve} = promiseWithResolvers < void > ( ) ;
144144
145145 const smartSplit = new SmartChunkSplit ( callback , this . state ) ;
146146
@@ -182,9 +182,9 @@ export default class DownloadEngineFetchStreamFetch extends BaseDownloadEngineFe
182182 onFinish ( new EmptyStreamTimeoutError ( `Stream timeout after ${ prettyMillisecondsCompact ( this . options . maxStreamWait ! ) } ` ) ) ;
183183 this . _activeController ?. abort ( ) ;
184184 }
185- }
185+ } ;
186186
187- let clearWatchdog = this . watchDog ( watchDogCallback ) ;
187+ const clearWatchdog = this . watchDog ( watchDogCallback ) ;
188188
189189 const onFinish = ( error ?: Error ) => {
190190 if ( finished ) return ;
@@ -211,7 +211,7 @@ export default class DownloadEngineFetchStreamFetch extends BaseDownloadEngineFe
211211 if ( this . aborted ) {
212212 onFinish ( ) ;
213213 return ;
214- } ;
214+ }
215215
216216 waitingForChunk = true ;
217217 waitStartedAt = Date . now ( ) ;
0 commit comments