@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.js
CHANGED
|
@@ -11700,7 +11700,7 @@ var require_mime_db = __commonJS({
|
|
|
11700
11700
|
}
|
|
11701
11701
|
});
|
|
11702
11702
|
|
|
11703
|
-
// node_modules/.pnpm/@shipstatic+types@0.
|
|
11703
|
+
// node_modules/.pnpm/@shipstatic+types@0.6.0/node_modules/@shipstatic/types/dist/index.js
|
|
11704
11704
|
var ErrorType;
|
|
11705
11705
|
(function(ErrorType2) {
|
|
11706
11706
|
ErrorType2["Validation"] = "validation_failed";
|
|
@@ -11986,31 +11986,10 @@ function useDrop(options) {
|
|
|
11986
11986
|
}));
|
|
11987
11987
|
const processedFiles = cleanFiles.map((file) => createProcessedFile(file));
|
|
11988
11988
|
const finalFiles = stripPrefix ? stripCommonPrefix(processedFiles) : processedFiles;
|
|
11989
|
-
const filesForValidation = finalFiles
|
|
11990
|
-
const browserUnknown = !f.file.type || f.file.type === "application/octet-stream";
|
|
11991
|
-
const mimeDbUnknown = !f.type || f.type === "application/octet-stream";
|
|
11992
|
-
const isUnknownType = browserUnknown && mimeDbUnknown;
|
|
11993
|
-
if (isUnknownType) {
|
|
11994
|
-
const textFile = new File([f.file], f.file.name, {
|
|
11995
|
-
type: "text/plain",
|
|
11996
|
-
lastModified: f.file.lastModified
|
|
11997
|
-
});
|
|
11998
|
-
if (f.file.webkitRelativePath) {
|
|
11999
|
-
Object.defineProperty(textFile, "webkitRelativePath", {
|
|
12000
|
-
value: f.file.webkitRelativePath,
|
|
12001
|
-
writable: false,
|
|
12002
|
-
configurable: true
|
|
12003
|
-
});
|
|
12004
|
-
}
|
|
12005
|
-
return { ...f, file: textFile, type: "text/plain" };
|
|
12006
|
-
}
|
|
12007
|
-
return f;
|
|
12008
|
-
});
|
|
11989
|
+
const filesForValidation = finalFiles;
|
|
12009
11990
|
const validatableFiles = filesForValidation.map((f) => ({
|
|
12010
11991
|
name: f.path,
|
|
12011
11992
|
// Use full path to match server-side validation
|
|
12012
|
-
type: f.type,
|
|
12013
|
-
// Use corrected MIME type from mime-db, not browser's File.type
|
|
12014
11993
|
size: f.file.size
|
|
12015
11994
|
}));
|
|
12016
11995
|
const config = await ship.getConfig();
|