mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-25 03:08:34 +00:00
And rewrite all the require calls. ```bash git mv src/utils/* packages/@uppy/utils/src sed -i 's/[./]*\/utils\//@uppy\/utils\/lib\//' src/**/*.js # transform (../)*utils → @uppy/utils ```
12 lines
401 B
JavaScript
12 lines
401 B
JavaScript
const getSpeed = require('./getSpeed')
|
|
const getBytesRemaining = require('./getBytesRemaining')
|
|
|
|
module.exports = function getETA (fileProgress) {
|
|
if (!fileProgress.bytesUploaded) return 0
|
|
|
|
const uploadSpeed = getSpeed(fileProgress)
|
|
const bytesRemaining = getBytesRemaining(fileProgress)
|
|
const secondsRemaining = Math.round(bytesRemaining / uploadSpeed * 10) / 10
|
|
|
|
return secondsRemaining
|
|
}
|