mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-27 04:05:10 +00:00
neglected in #4911: - bytesTotal can be null (also handle that bug in runtime) - progress is not a property on the progress object - use `satisfies` instead of `as` - add todo about broken `throttle` implementation - in emitSocketProgress, progressData should not have the FileProgress type, as it is a completely different type (it comes from companion)
6 lines
256 B
TypeScript
6 lines
256 B
TypeScript
import type { FileProgress } from './FileProgress'
|
|
|
|
export default function getBytesRemaining(fileProgress: FileProgress): number {
|
|
if (fileProgress.bytesTotal == null) return 0
|
|
return fileProgress.bytesTotal - (fileProgress.bytesUploaded as number)
|
|
}
|