Skip to content

Commit

Permalink
3.4.5
Browse files Browse the repository at this point in the history
  • Loading branch information
di4urp committed Dec 8, 2020
1 parent 3845efc commit 814ea95
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 24 deletions.
24 changes: 17 additions & 7 deletions dist/upyun.common.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* UPYUN js-sdk 3.4.4
* UPYUN js-sdk 3.4.5
* (c) 2020
* @license MIT
*/
Expand Down Expand Up @@ -188,7 +188,7 @@ function formUpload(remoteUrl, localFile, _ref) {
}

var name = "upyun";
var version = "3.4.4";
var version = "3.4.5";
var description = "UPYUN js sdk";
var main = "dist/upyun.common.js";
var module$1 = "dist/upyun.esm.js";
Expand Down Expand Up @@ -686,8 +686,13 @@ var Upyun = function () {
fileSizePromise = Promise.resolve(fileOrPath.size);
contentType = contentType || fileOrPath.type;
} else {
fileSizePromise = utils.getFileSizeAsync(fileOrPath);
contentType = contentType || utils.getContentType(fileOrPath);
if (Buffer.isBuffer(fileOrPath)) {
fileSizePromise = Promise.resolve(fileOrPath.length);
contentType = contentType || 'application/octet-stream';
} else {
fileSizePromise = utils.getFileSizeAsync(fileOrPath);
contentType = contentType || utils.getContentType(fileOrPath);
}
}

return fileSizePromise.then(function (fileSize) {
Expand Down Expand Up @@ -731,13 +736,18 @@ var Upyun = function () {
fileSizePromise = Promise.resolve(fileOrPath.size);
// contentType = fileOrPath.type
} else {
fileSizePromise = utils.getFileSizeAsync(fileOrPath);
// contentType = utils.getContentType(fileOrPath)
if (Buffer.isBuffer(fileOrPath)) {
fileSizePromise = Promise.resolve(fileOrPath.length);
} else {
fileSizePromise = utils.getFileSizeAsync(fileOrPath);
// contentType = utils.getContentType(fileOrPath)
}
}

var blockPromise = fileSizePromise.then(function (fileSize) {
var end = Math.min(start + PARTSIZE, fileSize);
return utils.readBlockAsync(fileOrPath, start, end);

return Buffer.isBuffer(fileOrPath) ? fileOrPath.slice(start, end) : utils.readBlockAsync(fileOrPath, start, end);
});

return blockPromise.then(function (block) {
Expand Down
24 changes: 17 additions & 7 deletions dist/upyun.esm.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* UPYUN js-sdk 3.4.4
* UPYUN js-sdk 3.4.5
* (c) 2020
* @license MIT
*/
Expand Down Expand Up @@ -1980,7 +1980,7 @@ var base64 = createCommonjsModule(function (module, exports) {
});

var name = "upyun";
var version = "3.4.4";
var version = "3.4.5";
var description = "UPYUN js sdk";
var main = "dist/upyun.common.js";
var module$1 = "dist/upyun.esm.js";
Expand Down Expand Up @@ -2796,8 +2796,13 @@ var Upyun = function () {
fileSizePromise = Promise.resolve(fileOrPath.size);
contentType = contentType || fileOrPath.type;
} else {
fileSizePromise = utils.getFileSizeAsync(fileOrPath);
contentType = contentType || utils.getContentType(fileOrPath);
if (Buffer.isBuffer(fileOrPath)) {
fileSizePromise = Promise.resolve(fileOrPath.length);
contentType = contentType || 'application/octet-stream';
} else {
fileSizePromise = utils.getFileSizeAsync(fileOrPath);
contentType = contentType || utils.getContentType(fileOrPath);
}
}

return fileSizePromise.then(function (fileSize) {
Expand Down Expand Up @@ -2841,13 +2846,18 @@ var Upyun = function () {
fileSizePromise = Promise.resolve(fileOrPath.size);
// contentType = fileOrPath.type
} else {
fileSizePromise = utils.getFileSizeAsync(fileOrPath);
// contentType = utils.getContentType(fileOrPath)
if (Buffer.isBuffer(fileOrPath)) {
fileSizePromise = Promise.resolve(fileOrPath.length);
} else {
fileSizePromise = utils.getFileSizeAsync(fileOrPath);
// contentType = utils.getContentType(fileOrPath)
}
}

var blockPromise = fileSizePromise.then(function (fileSize) {
var end = Math.min(start + PARTSIZE, fileSize);
return utils.readBlockAsync(fileOrPath, start, end);

return Buffer.isBuffer(fileOrPath) ? fileOrPath.slice(start, end) : utils.readBlockAsync(fileOrPath, start, end);
});

return blockPromise.then(function (block) {
Expand Down
24 changes: 17 additions & 7 deletions dist/upyun.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* UPYUN js-sdk 3.4.4
* UPYUN js-sdk 3.4.5
* (c) 2020
* @license MIT
*/
Expand Down Expand Up @@ -1986,7 +1986,7 @@ var base64 = createCommonjsModule(function (module, exports) {
});

var name = "upyun";
var version = "3.4.4";
var version = "3.4.5";
var description = "UPYUN js sdk";
var main = "dist/upyun.common.js";
var module$1 = "dist/upyun.esm.js";
Expand Down Expand Up @@ -2802,8 +2802,13 @@ var Upyun = function () {
fileSizePromise = Promise.resolve(fileOrPath.size);
contentType = contentType || fileOrPath.type;
} else {
fileSizePromise = utils.getFileSizeAsync(fileOrPath);
contentType = contentType || utils.getContentType(fileOrPath);
if (Buffer.isBuffer(fileOrPath)) {
fileSizePromise = Promise.resolve(fileOrPath.length);
contentType = contentType || 'application/octet-stream';
} else {
fileSizePromise = utils.getFileSizeAsync(fileOrPath);
contentType = contentType || utils.getContentType(fileOrPath);
}
}

return fileSizePromise.then(function (fileSize) {
Expand Down Expand Up @@ -2847,13 +2852,18 @@ var Upyun = function () {
fileSizePromise = Promise.resolve(fileOrPath.size);
// contentType = fileOrPath.type
} else {
fileSizePromise = utils.getFileSizeAsync(fileOrPath);
// contentType = utils.getContentType(fileOrPath)
if (Buffer.isBuffer(fileOrPath)) {
fileSizePromise = Promise.resolve(fileOrPath.length);
} else {
fileSizePromise = utils.getFileSizeAsync(fileOrPath);
// contentType = utils.getContentType(fileOrPath)
}
}

var blockPromise = fileSizePromise.then(function (fileSize) {
var end = Math.min(start + PARTSIZE, fileSize);
return utils.readBlockAsync(fileOrPath, start, end);

return Buffer.isBuffer(fileOrPath) ? fileOrPath.slice(start, end) : utils.readBlockAsync(fileOrPath, start, end);
});

return blockPromise.then(function (block) {
Expand Down
4 changes: 2 additions & 2 deletions dist/upyun.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "upyun",
"version": "3.4.4",
"version": "3.4.5",
"description": "UPYUN js sdk",
"main": "dist/upyun.common.js",
"module": "dist/upyun.esm.js",
Expand Down

0 comments on commit 814ea95

Please sign in to comment.