Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@uploadthing/dropzone

Package Overview
Dependencies
Maintainers
1
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uploadthing/dropzone - npm Package Compare versions

Comparing version 0.1.4-canary.aa58d1b to 0.2.0

32

core/index.js

@@ -1,6 +0,28 @@

import attrAccepts from 'attr-accept';
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const accepts = // @ts-expect-error - ESM interop
typeof attrAccepts === "function" ? attrAccepts : attrAccepts.default;
/**
* This is a forked version of the react-dropzone package, that's been minified
* to suit UploadThing's needs and be easily portable to other frameworks than React.
* See original source here: https://github.com/react-dropzone/react-dropzone
* The original package is licensed under the MIT license.
*/ /**
* Copyright (c) (MIT License) 2015 Andrey Okonetchnikov
* https://github.com/react-dropzone/attr-accept/blob/master/src/index.js
*/ function accepts(file, acceptedFiles) {
if (file && acceptedFiles) {
const acceptedFilesArray = Array.isArray(acceptedFiles) ? acceptedFiles : acceptedFiles.split(",");
const fileName = file.name ?? "";
const mimeType = (file.type ?? "").toLowerCase();
const baseMimeType = mimeType.replace(/\/.*$/, "");
return acceptedFilesArray.some((type)=>{
const validType = type.trim().toLowerCase();
if (validType.startsWith(".")) {
return fileName.toLowerCase().endsWith(validType);
} else if (validType.endsWith("/*")) {
// This is something like a image/* mime type
return baseMimeType === validType.replace(/\/.*$/, "");
}
return mimeType === validType;
});
}
return true;
}
// Firefox versions prior to 53 return a bogus MIME type for every file drag, so dragovers with

@@ -7,0 +29,0 @@ // that MIME type will always be accepted

9

package.json
{
"name": "@uploadthing/dropzone",
"version": "0.1.4-canary.aa58d1b",
"version": "0.2.0",
"type": "module",

@@ -48,13 +48,12 @@ "license": "MIT",

"dependencies": {
"attr-accept": "^2.2.2",
"file-selector": "^0.6.0"
},
"devDependencies": {
"@types/react": "18.2.55",
"@types/react": "18.2.60",
"@uploadthing/eslint-config": "0.2.0",
"@uploadthing/tsconfig": "0.1.0",
"bunchee": "^4.4.8",
"eslint": "^8.56.0",
"eslint": "^8.57.0",
"react": "18.2.0",
"solid-js": "^1.7.11",
"solid-js": "^1.8.15",
"typescript": "^5.3.3"

@@ -61,0 +60,0 @@ },

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc