@shipstatic/drop 0.2.7 → 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 +18 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +18 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -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",
|