@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.js CHANGED
@@ -11700,7 +11700,7 @@ var require_mime_db = __commonJS({
11700
11700
  }
11701
11701
  });
11702
11702
 
11703
- // node_modules/.pnpm/@shipstatic+types@0.4.16/node_modules/@shipstatic/types/dist/index.js
11703
+ // node_modules/.pnpm/@shipstatic+types@0.4.19/node_modules/@shipstatic/types/dist/index.js
11704
11704
  var ErrorType;
11705
11705
  (function(ErrorType2) {
11706
11706
  ErrorType2["Validation"] = "validation_failed";
@@ -11979,8 +11979,25 @@ function useDrop(options) {
11979
11979
  }));
11980
11980
  const processedFiles = cleanFiles.map((file) => createProcessedFile(file));
11981
11981
  const finalFiles = stripPrefix ? stripCommonPrefix(processedFiles) : processedFiles;
11982
+ const filesForValidation = finalFiles.map((f) => {
11983
+ if (f.file.type === "application/octet-stream") {
11984
+ const textFile = new File([f.file], f.file.name, {
11985
+ type: "text/plain",
11986
+ lastModified: f.file.lastModified
11987
+ });
11988
+ if (f.file.webkitRelativePath) {
11989
+ Object.defineProperty(textFile, "webkitRelativePath", {
11990
+ value: f.file.webkitRelativePath,
11991
+ writable: false,
11992
+ configurable: true
11993
+ });
11994
+ }
11995
+ return { ...f, file: textFile };
11996
+ }
11997
+ return f;
11998
+ });
11982
11999
  const config = await ship.getConfig();
11983
- const validation = validateFiles(finalFiles, config);
12000
+ const validation = validateFiles(filesForValidation, config);
11984
12001
  if (validation.error) {
11985
12002
  setState({
11986
12003
  value: "error",