New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

qiniu-web-uploader

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

qiniu-web-uploader - npm Package Compare versions

Comparing version

to
2.1.1

@@ -135,14 +135,24 @@ 'use strict';

var err = void 0;
xhr.addEventListener('load', function (e) {
var res = JSON.parse(xhr.responseText);
cb(err, res);
});
xhr.addEventListener('error', function (e) {
if (_this4._errorTry) {
_this4._errorTry--;
_this4._execPost(url, data, contentType, cb);
} else {
cb(e, {});
}
});
if (xhr.addEventListener) {
xhr.addEventListener('load', function (e) {
var res = JSON.parse(xhr.responseText);
cb(err, res);
});
xhr.addEventListener('error', function (e) {
if (_this4._errorTry) {
_this4._errorTry--;
_this4._execPost(url, data, contentType, cb);
} else {
cb(e, {});
}
});
} else {
xhr.onreadystatechange = function () {
if (xhr.readyState == 4 && xhr.status == 200) {
var res = JSON.parse(xhr.responseText);
cb(err, res);
}
};
xhr.onerror = function (e) {};
}
xhr.open('POST', url, true);

@@ -149,0 +159,0 @@ xhr.setRequestHeader('Content-Type', contentType);

{
"name": "qiniu-web-uploader",
"version": "2.1.0",
"version": "2.1.1",
"description": "七牛上传模块",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -130,14 +130,24 @@ import { EventEmitter } from 'events';

let err;
xhr.addEventListener('load', e => {
let res = JSON.parse(xhr.responseText);
cb(err, res);
});
xhr.addEventListener('error', e => {
if(this._errorTry) {
this._errorTry --;
this._execPost(url, data, contentType, cb);
} else {
cb(e, {});
if(xhr.addEventListener) {
xhr.addEventListener('load', e => {
let res = JSON.parse(xhr.responseText);
cb(err, res);
});
xhr.addEventListener('error', e => {
if(this._errorTry) {
this._errorTry --;
this._execPost(url, data, contentType, cb);
} else {
cb(e, {});
}
});
} else {
xhr.onreadystatechange = () => {
if(xhr.readyState==4 && xhr.status==200){
let res = JSON.parse(xhr.responseText);
cb(err, res);
}
}
});
xhr.onerror = e => {};
}
xhr.open('POST', url, true);

@@ -144,0 +154,0 @@ xhr.setRequestHeader('Content-Type', contentType);