@uppy/utils
Advanced tools
Comparing version 5.1.1 to 5.1.2
# @uppy/utils | ||
## 5.1.2 | ||
Released: 2023-01-26 | ||
Included in: Uppy v3.4.0 | ||
- @uppy/utils: better fallbacks for the drag & drop API (Antoine du Hamel / #4260) | ||
- @uppy/utils: Fix getSpeed type (referenced `bytesTotal` instead of `uploadStarted`) (Pascal Wengerter / #4263) | ||
## 5.1.1 | ||
@@ -4,0 +12,0 @@ |
@@ -31,3 +31,7 @@ import getFilesAndDirectoriesFromDirectory from './getFilesAndDirectoriesFromDirectory.js'; | ||
async function* createPromiseToAddFileOrParseDirectory(entry, relativePath) { | ||
async function* createPromiseToAddFileOrParseDirectory(entry, relativePath, lastResortFile) { | ||
if (lastResortFile === void 0) { | ||
lastResortFile = undefined; | ||
} | ||
// For each dropped item, - make sure it's a file/directory, and start deepening in! | ||
@@ -40,3 +44,3 @@ if (entry.kind === 'file') { | ||
yield file; | ||
} | ||
} else if (lastResortFile != null) yield lastResortFile; | ||
} else if (entry.kind === 'directory') { | ||
@@ -46,3 +50,3 @@ for await (const handle of entry.values()) { | ||
} | ||
} | ||
} else if (lastResortFile != null) yield lastResortFile; | ||
} | ||
@@ -70,5 +74,5 @@ | ||
try { | ||
yield* createPromiseToAddFileOrParseDirectory(entry, ''); | ||
yield* createPromiseToAddFileOrParseDirectory(entry, '', lastResortFile); | ||
} catch (err) { | ||
if (lastResortFile) { | ||
if (lastResortFile != null) { | ||
yield lastResortFile; | ||
@@ -79,4 +83,4 @@ } else { | ||
} | ||
} | ||
} else if (lastResortFile != null) yield lastResortFile; | ||
} | ||
} |
{ | ||
"name": "@uppy/utils", | ||
"description": "Shared utility functions for Uppy Core and plugins maintained by the Uppy team.", | ||
"version": "5.1.1", | ||
"version": "5.1.2", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "types": "types/index.d.ts", |
@@ -28,3 +28,3 @@ import getFilesAndDirectoriesFromDirectory from './getFilesAndDirectoriesFromDirectory.js' | ||
async function* createPromiseToAddFileOrParseDirectory (entry, relativePath) { | ||
async function* createPromiseToAddFileOrParseDirectory (entry, relativePath, lastResortFile = undefined) { | ||
// For each dropped item, - make sure it's a file/directory, and start deepening in! | ||
@@ -36,3 +36,3 @@ if (entry.kind === 'file') { | ||
yield file | ||
} | ||
} else if (lastResortFile != null) yield lastResortFile | ||
} else if (entry.kind === 'directory') { | ||
@@ -42,3 +42,3 @@ for await (const handle of entry.values()) { | ||
} | ||
} | ||
} else if (lastResortFile != null) yield lastResortFile | ||
} | ||
@@ -59,5 +59,5 @@ | ||
try { | ||
yield* createPromiseToAddFileOrParseDirectory(entry, '') | ||
yield* createPromiseToAddFileOrParseDirectory(entry, '', lastResortFile) | ||
} catch (err) { | ||
if (lastResortFile) { | ||
if (lastResortFile != null) { | ||
yield lastResortFile | ||
@@ -68,4 +68,4 @@ } else { | ||
} | ||
} | ||
} else if (lastResortFile != null) yield lastResortFile | ||
} | ||
} |
@@ -192,4 +192,4 @@ declare module '@uppy/utils/lib/Translator' { | ||
function getSpeed (progress: { | ||
bytesTotal: number | ||
bytesUploaded: number | ||
uploadStarted: number | ||
}): number | ||
@@ -196,0 +196,0 @@ export default getSpeed |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
243438
3278