@shipstatic/drop 0.2.19 → 0.2.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -23
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -11702,7 +11702,7 @@ var require_mime_db = __commonJS({
|
|
|
11702
11702
|
}
|
|
11703
11703
|
});
|
|
11704
11704
|
|
|
11705
|
-
// node_modules/.pnpm/@shipstatic+types@0.
|
|
11705
|
+
// node_modules/.pnpm/@shipstatic+types@0.6.0/node_modules/@shipstatic/types/dist/index.js
|
|
11706
11706
|
var ErrorType;
|
|
11707
11707
|
(function(ErrorType2) {
|
|
11708
11708
|
ErrorType2["Validation"] = "validation_failed";
|
|
@@ -11988,31 +11988,10 @@ function useDrop(options) {
|
|
|
11988
11988
|
}));
|
|
11989
11989
|
const processedFiles = cleanFiles.map((file) => createProcessedFile(file));
|
|
11990
11990
|
const finalFiles = stripPrefix ? stripCommonPrefix(processedFiles) : processedFiles;
|
|
11991
|
-
const filesForValidation = finalFiles
|
|
11992
|
-
const browserUnknown = !f.file.type || f.file.type === "application/octet-stream";
|
|
11993
|
-
const mimeDbUnknown = !f.type || f.type === "application/octet-stream";
|
|
11994
|
-
const isUnknownType = browserUnknown && mimeDbUnknown;
|
|
11995
|
-
if (isUnknownType) {
|
|
11996
|
-
const textFile = new File([f.file], f.file.name, {
|
|
11997
|
-
type: "text/plain",
|
|
11998
|
-
lastModified: f.file.lastModified
|
|
11999
|
-
});
|
|
12000
|
-
if (f.file.webkitRelativePath) {
|
|
12001
|
-
Object.defineProperty(textFile, "webkitRelativePath", {
|
|
12002
|
-
value: f.file.webkitRelativePath,
|
|
12003
|
-
writable: false,
|
|
12004
|
-
configurable: true
|
|
12005
|
-
});
|
|
12006
|
-
}
|
|
12007
|
-
return { ...f, file: textFile, type: "text/plain" };
|
|
12008
|
-
}
|
|
12009
|
-
return f;
|
|
12010
|
-
});
|
|
11991
|
+
const filesForValidation = finalFiles;
|
|
12011
11992
|
const validatableFiles = filesForValidation.map((f) => ({
|
|
12012
11993
|
name: f.path,
|
|
12013
11994
|
// Use full path to match server-side validation
|
|
12014
|
-
type: f.type,
|
|
12015
|
-
// Use corrected MIME type from mime-db, not browser's File.type
|
|
12016
11995
|
size: f.file.size
|
|
12017
11996
|
}));
|
|
12018
11997
|
const config = await ship$1.getConfig();
|