@shipstatic/drop 0.2.6 → 0.2.8
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 +19 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +19 -2
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
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.4.
|
|
11705
|
+
// node_modules/.pnpm/@shipstatic+types@0.4.19/node_modules/@shipstatic/types/dist/index.js
|
|
11706
11706
|
var ErrorType;
|
|
11707
11707
|
(function(ErrorType2) {
|
|
11708
11708
|
ErrorType2["Validation"] = "validation_failed";
|
|
@@ -11981,8 +11981,25 @@ function useDrop(options) {
|
|
|
11981
11981
|
}));
|
|
11982
11982
|
const processedFiles = cleanFiles.map((file) => createProcessedFile(file));
|
|
11983
11983
|
const finalFiles = stripPrefix ? stripCommonPrefix(processedFiles) : processedFiles;
|
|
11984
|
+
const filesForValidation = finalFiles.map((f) => {
|
|
11985
|
+
if (f.file.type === "application/octet-stream") {
|
|
11986
|
+
const textFile = new File([f.file], f.file.name, {
|
|
11987
|
+
type: "text/plain",
|
|
11988
|
+
lastModified: f.file.lastModified
|
|
11989
|
+
});
|
|
11990
|
+
if (f.file.webkitRelativePath) {
|
|
11991
|
+
Object.defineProperty(textFile, "webkitRelativePath", {
|
|
11992
|
+
value: f.file.webkitRelativePath,
|
|
11993
|
+
writable: false,
|
|
11994
|
+
configurable: true
|
|
11995
|
+
});
|
|
11996
|
+
}
|
|
11997
|
+
return { ...f, file: textFile };
|
|
11998
|
+
}
|
|
11999
|
+
return f;
|
|
12000
|
+
});
|
|
11984
12001
|
const config = await ship$1.getConfig();
|
|
11985
|
-
const validation = ship.validateFiles(
|
|
12002
|
+
const validation = ship.validateFiles(filesForValidation, config);
|
|
11986
12003
|
if (validation.error) {
|
|
11987
12004
|
setState({
|
|
11988
12005
|
value: "error",
|