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.0 to 4.0.1

12

CHANGELOG.md
CHANGELOG
===
4.0.1
--
Fix
-
Options access modifier reverted to public.
4.0.0
--
Changed localizations
-
Localizations are now accessible through new options property with specific errors.
3.0.0

@@ -5,0 +17,0 @@ --

5

index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function addEventHandler(el, event, handler) {

@@ -91,5 +92,3 @@ if (el.addEventListener) {

+ ' or its size is 0 MB. Please choose another file.'; },
fileTypeInvalid: function (accept) { return 'File format is not allowed. Only ' + (accept
? accept.split('.').join(' ')
: '') + ' files are allowed.'; },
fileTypeInvalid: function (accept) { return 'File format is not allowed. Only ' + (accept ? accept : '') + ' files are allowed.'; },
invalidResponseFromServer: function () { return 'Invalid response from server'; }

@@ -96,0 +95,0 @@ };

45

index.ts

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

export interface IFullUploadAreaOptions extends IUploadAreaOptions {
maxFileSize: number;
allowDragDrop: boolean | (() => boolean);
clickable: boolean | (() => boolean);
accept: string;
multiple: boolean;
validateExtension: boolean;
localizer: ILocalizer;
}
export interface IFullUploadOptions extends IUploadOptions {
withCredentials: boolean;
headers: { [key: string]: string | number | boolean };
params: { [key: string]: string | number | boolean };
localizer: ILocalizer;
}
export interface ILocalizer {

@@ -113,5 +131,3 @@ fileSizeInvalid: (maxFileSize: number) => string;

+ ' or its size is 0 MB. Please choose another file.',
fileTypeInvalid: accept => 'File format is not allowed. Only ' + (accept
? accept.split('.').join(' ')
: '') + ' files are allowed.',
fileTypeInvalid: accept => 'File format is not allowed. Only ' + (accept ? accept : '') + ' files are allowed.',
invalidResponseFromServer: () => 'Invalid response from server'

@@ -139,12 +155,2 @@ };

interface IFullUploadAreaOptions extends IUploadAreaOptions {
maxFileSize: number;
allowDragDrop: boolean | (() => boolean);
clickable: boolean | (() => boolean);
accept: string;
multiple: boolean;
validateExtension: boolean;
localizer: ILocalizer;
}
export interface IUploadCallbacks {

@@ -188,9 +194,2 @@ onProgressCallback?: (file: IUploadFile) => void;

interface IFullUploadOptions extends IUploadOptions {
withCredentials: boolean;
headers: { [key: string]: string | number | boolean };
params: { [key: string]: string | number | boolean };
localizer: ILocalizer;
}
export interface IUploadQueueCallbacks extends IUploadCallbacks {

@@ -233,3 +232,3 @@ onFileAddedCallback?: (file: IUploadFile) => void;

public uploader: Uploader;
private options: IFullUploadAreaOptions;
public options: IFullUploadAreaOptions;
private uploadCore: UploadCore;

@@ -524,4 +523,4 @@ private fileInput: HTMLInputElement;

export class UploadCore {
private options: IFullUploadOptions;
private callbacks: IUploadCallbacksExt;
public options: IFullUploadOptions;
public callbacks: IUploadCallbacksExt;

@@ -528,0 +527,0 @@ constructor(options: IUploadOptions, callbacks: IUploadCallbacksExt = {}) {

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

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

@@ -20,2 +20,21 @@ declare module "pure-upload" {

}
export interface IFullUploadAreaOptions extends IUploadAreaOptions {
maxFileSize: number;
allowDragDrop: boolean | (() => boolean);
clickable: boolean | (() => boolean);
accept: string;
multiple: boolean;
validateExtension: boolean;
localizer: ILocalizer;
}
export interface IFullUploadOptions extends IUploadOptions {
withCredentials: boolean;
headers: {
[key: string]: string | number | boolean;
};
params: {
[key: string]: string | number | boolean;
};
localizer: ILocalizer;
}
export interface ILocalizer {

@@ -98,3 +117,3 @@ fileSizeInvalid: (maxFileSize: number) => string;

uploader: Uploader;
private options;
options: IFullUploadAreaOptions;
private uploadCore;

@@ -129,4 +148,4 @@ private fileInput;

export class UploadCore {
private options;
private callbacks;
options: IFullUploadOptions;
callbacks: IUploadCallbacksExt;
constructor(options: IUploadOptions, callbacks?: IUploadCallbacksExt);

@@ -133,0 +152,0 @@ upload(fileList: File[] | Object): void;

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

fileTypeInvalid: (accept: string) => string;
invalidResponseFromServer: () => string;
```

@@ -95,0 +96,0 @@ ### Upload file

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