@uppy/xhr-upload
Advanced tools
Comparing version 1.2.0 to 1.3.0
@@ -49,4 +49,4 @@ var _class, _temp; | ||
* | ||
* @param {Object} file File object with `data`, `size` and `meta` properties | ||
* @returns {Object} blob updated with the new `type` set from `file.meta.type` | ||
* @param {object} file File object with `data`, `size` and `meta` properties | ||
* @returns {object} blob updated with the new `type` set from `file.meta.type` | ||
*/ | ||
@@ -96,3 +96,3 @@ | ||
* @property {string} statusText | ||
* @property {Object.<string, string>} headers | ||
* @property {object.<string, string>} headers | ||
* | ||
@@ -573,2 +573,6 @@ * @param {string} responseText the response body string | ||
if (this.opts.limit === 0) { | ||
this.uppy.log('[XHRUpload] When uploading multiple files at once, consider setting the `limit` option (to `10` for example), to limit the number of concurrent uploads, which helps prevent memory and network issues: https://uppy.io/docs/xhr-upload/#limit-0', 'warning'); | ||
} | ||
this.uppy.log('[XHRUpload] Uploading...'); | ||
@@ -580,2 +584,11 @@ var files = fileIDs.map(function (fileID) { | ||
if (this.opts.bundle) { | ||
// if bundle: true, we don’t support remote uploads | ||
var isSomeFileRemote = files.some(function (file) { | ||
return file.isRemote; | ||
}); | ||
if (isSomeFileRemote) { | ||
throw new Error('Can’t upload remote files when bundle: true option is set'); | ||
} | ||
return this.uploadBundle(files); | ||
@@ -620,2 +633,2 @@ } | ||
return XHRUpload; | ||
}(Plugin), _class.VERSION = "1.2.0", _temp); | ||
}(Plugin), _class.VERSION = "1.3.0", _temp); |
{ | ||
"name": "@uppy/xhr-upload", | ||
"description": "Plain and simple classic HTML multipart form uploads with Uppy, as well as uploads using the HTTP PUT method.", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"license": "MIT", | ||
@@ -27,13 +27,10 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@uppy/companion-client": "1.2.0", | ||
"@uppy/utils": "1.2.0", | ||
"@uppy/companion-client": "^1.3.0", | ||
"@uppy/utils": "^1.3.0", | ||
"cuid": "^2.1.1" | ||
}, | ||
"devDependencies": { | ||
"@uppy/core": "1.2.0" | ||
}, | ||
"peerDependencies": { | ||
"@uppy/core": "^1.0.0" | ||
}, | ||
"gitHead": "bd2beedcffbaa840de7069860e341f02268ddbb1" | ||
"gitHead": "056a7114a15fc7480a4014342d7f2c19305dc96c" | ||
} |
@@ -29,4 +29,4 @@ const { Plugin } = require('@uppy/core') | ||
* | ||
* @param {Object} file File object with `data`, `size` and `meta` properties | ||
* @returns {Object} blob updated with the new `type` set from `file.meta.type` | ||
* @param {object} file File object with `data`, `size` and `meta` properties | ||
* @returns {object} blob updated with the new `type` set from `file.meta.type` | ||
*/ | ||
@@ -71,3 +71,3 @@ function setTypeInBlob (file) { | ||
* @property {string} statusText | ||
* @property {Object.<string, string>} headers | ||
* @property {object.<string, string>} headers | ||
* | ||
@@ -109,3 +109,3 @@ * @param {string} responseText the response body string | ||
// i18n | ||
this.translator = new Translator([ this.defaultLocale, this.uppy.locale, this.opts.locale ]) | ||
this.translator = new Translator([this.defaultLocale, this.uppy.locale, this.opts.locale]) | ||
this.i18n = this.translator.translate.bind(this.translator) | ||
@@ -539,2 +539,9 @@ this.i18nArray = this.translator.translateArray.bind(this.translator) | ||
if (this.opts.limit === 0) { | ||
this.uppy.log( | ||
'[XHRUpload] When uploading multiple files at once, consider setting the `limit` option (to `10` for example), to limit the number of concurrent uploads, which helps prevent memory and network issues: https://uppy.io/docs/xhr-upload/#limit-0', | ||
'warning' | ||
) | ||
} | ||
this.uppy.log('[XHRUpload] Uploading...') | ||
@@ -544,2 +551,8 @@ const files = fileIDs.map((fileID) => this.uppy.getFile(fileID)) | ||
if (this.opts.bundle) { | ||
// if bundle: true, we don’t support remote uploads | ||
const isSomeFileRemote = files.some(file => file.isRemote) | ||
if (isSomeFileRemote) { | ||
throw new Error('Can’t upload remote files when bundle: true option is set') | ||
} | ||
return this.uploadBundle(files) | ||
@@ -546,0 +559,0 @@ } |
43737
0
1094
+ Added@uppy/companion-client@1.10.2(transitive)
+ Added@uppy/utils@1.3.0(transitive)
+ Addedqs-stringify@1.2.1(transitive)
+ Addedquerystringify@2.2.0(transitive)
+ Addedrequires-port@1.0.0(transitive)
+ Addedurl-parse@1.5.10(transitive)
- Removed@uppy/companion-client@1.2.0(transitive)
- Removed@uppy/utils@1.2.0(transitive)
Updated@uppy/utils@^1.3.0