Skip to content

Commit

Permalink
rename fetchWithNetworkError and getBytesRemaining to TS
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Sep 25, 2023
1 parent 5d50cbb commit 676708b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import NetworkError from './NetworkError.js'
/**
* Wrapper around window.fetch that throws a NetworkError when appropriate
*/
export default function fetchWithNetworkError (...options) {
export default function fetchWithNetworkError (...options: Parameters<typeof globalThis.fetch>) {
return fetch(...options)
.catch((err) => {
if (err.name === 'AbortError') {
Expand Down
3 changes: 0 additions & 3 deletions packages/@uppy/utils/src/getBytesRemaining.js

This file was deleted.

6 changes: 6 additions & 0 deletions packages/@uppy/utils/src/getBytesRemaining.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default function getBytesRemaining (fileProgress: {
bytesTotal: number
bytesUploaded: number
}) {
return fileProgress.bytesTotal - fileProgress.bytesUploaded
}

0 comments on commit 676708b

Please sign in to comment.