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

pure-upload

Package Overview
Dependencies
Maintainers
1
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pure-upload - npm Package Compare versions

Comparing version 4.0.1 to 4.1.0

4

CHANGELOG.md
CHANGELOG
===
4.1.0
--
Added option to allow upload of empty files
4.0.1

@@ -4,0 +8,0 @@ --

3

index.js

@@ -157,2 +157,3 @@ "use strict";

multiple: true,
allowEmptyFile: false
};

@@ -342,3 +343,3 @@ };

var maxFileSize = this.options.maxFileSize * 1024 * 1024; // max file size in bytes
if (file.size > maxFileSize || file.size === 0)
if (file.size > maxFileSize || (!this.options.allowEmptyFile && file.size === 0))
return false;

@@ -345,0 +346,0 @@ return true;

@@ -58,3 +58,3 @@ export function addEventHandler(el: Element | HTMLElement, event: string, handler: (ev: UIEvent) => void) {

for (var nextKey in source) {
for (let nextKey in source) {
if (Object.prototype.hasOwnProperty.call(source, nextKey) && (to[nextKey] === undefined || to[nextKey] === null)) {

@@ -147,2 +147,3 @@ to[nextKey] = source[nextKey];

manualStart?: boolean;
allowEmptyFile?: boolean;

@@ -291,2 +292,3 @@ onFileAdded?: (file: IUploadFile) => void;

multiple: true,
allowEmptyFile: false
};

@@ -490,3 +492,3 @@ }

let maxFileSize = this.options.maxFileSize * 1024 * 1024; // max file size in bytes
if (file.size > maxFileSize || file.size === 0) return false;
if (file.size > maxFileSize || (!this.options.allowEmptyFile && file.size === 0)) return false;
return true;

@@ -493,0 +495,0 @@ }

{
"name": "pure-upload",
"version": "4.0.1",
"version": "4.1.0",
"description": "The pure upload library without dependencies",

@@ -5,0 +5,0 @@ "author": {

@@ -56,2 +56,3 @@ declare module "pure-upload" {

manualStart?: boolean;
allowEmptyFile?: boolean;
onFileAdded?: (file: IUploadFile) => void;

@@ -58,0 +59,0 @@ onFileSelected?: (file: IUploadFile) => void;

@@ -79,2 +79,3 @@ # Pure-upload

manualStart?: boolean;
allowEmptyFile?: boolean;
onFileAdded?: (file: IUploadFile) => void;

@@ -81,0 +82,0 @@ onFileSelected?: (file: IUploadFile) => void;

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