@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.js CHANGED
@@ -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",