mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-22 09:48:06 +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 ```
7 lines
256 B
JavaScript
7 lines
256 B
JavaScript
module.exports = function getSpeed (fileProgress) {
|
|
if (!fileProgress.bytesUploaded) return 0
|
|
|
|
const timeElapsed = (new Date()) - fileProgress.uploadStarted
|
|
const uploadSpeed = fileProgress.bytesUploaded / (timeElapsed / 1000)
|
|
return uploadSpeed
|
|
}
|