()
| 333 | } |
| 334 | }, |
| 335 | async complete() { |
| 336 | try { |
| 337 | if (!backend) { |
| 338 | // Never crossed one part (or local provider): single-shot upload. |
| 339 | await uploadFile({ |
| 340 | file: drainPending(), |
| 341 | fileName: key, |
| 342 | contentType, |
| 343 | context, |
| 344 | preserveKey: true, |
| 345 | customKey: key, |
| 346 | }) |
| 347 | return { key, size: totalBytes } |
| 348 | } |
| 349 | if (pendingBytes > 0) await dispatchPart(drainPending()) |
| 350 | await Promise.all(inflight) |
| 351 | if (firstError) throw firstError |
| 352 | await backend.finish() |
| 353 | return { key, size: totalBytes } |
| 354 | } catch (err) { |
| 355 | await abort() |
| 356 | throw err |
| 357 | } |
| 358 | }, |
| 359 | abort, |
| 360 | } |
| 361 | } |
nothing calls this directly
no test coverage detected