Comparing version 4.6.2 to 4.6.3
4.6.3 / 2016-12-20 | ||
================== | ||
* fix request stream bug of the multipart upload feature (#155) | ||
* chore(package): update dateformat to version 2.0.0 (#156) | ||
* doc: param "file" of `*get` method is optional (#158) | ||
4.6.2 / 2016-10-28 | ||
@@ -3,0 +10,0 @@ ================== |
@@ -240,2 +240,4 @@ 'use strict'; | ||
data.stream = null; | ||
params.stream = null; | ||
return { | ||
@@ -325,16 +327,49 @@ name: name, | ||
this.file = file; | ||
this.reader = null; | ||
this.reader = new FileReader(); | ||
this.start = 0; | ||
this.finish = false; | ||
this.fileBuffer; | ||
}; | ||
util.inherits(WebFileReadStream, Readable); | ||
WebFileReadStream.prototype._read = function _read() { | ||
if (!this.reader) { | ||
var that = this; | ||
that.reader = new FileReader(); | ||
that.reader.onload = function (e) { | ||
that.push(new Buffer(new Uint8Array(e.target.result))); | ||
that.push(null); | ||
}; | ||
that.reader.readAsArrayBuffer(that.file); | ||
WebFileReadStream.prototype.readFileAndPush = function readFileAndPush(size) { | ||
if (this.fileBuffer){ | ||
var pushRet = true; | ||
while (this.start < this.fileBuffer.length && pushRet) { | ||
var start = this.start; | ||
var end = start + size; | ||
end = end > this.fileBuffer.length ? this.fileBuffer.length : end; | ||
this.start = end; | ||
pushRet = this.push(this.fileBuffer.slice(start, end)); | ||
} | ||
} | ||
} | ||
WebFileReadStream.prototype._read = function _read(size) { | ||
if ((this.file && this.start >= this.file.size) || | ||
(this.fileBuffer && this.start >= this.fileBuffer.length) || | ||
(this.finish) || (0 == this.start && !this.file)) { | ||
if (!this.finish) { | ||
this.fileBuffer = null; | ||
this.finish = true; | ||
} | ||
this.push(null); | ||
return; | ||
} | ||
var defaultReadSize = 16 * 1024; | ||
size = size ? size : defaultReadSize; | ||
var that = this; | ||
this.reader.onload = function (e) { | ||
that.fileBuffer = new Buffer(new Uint8Array(e.target.result)); | ||
that.file = null; | ||
that.readFileAndPush(size); | ||
}; | ||
if (0 == this.start) { | ||
this.reader.readAsArrayBuffer(this.file); | ||
} else { | ||
this.readFileAndPush(size); | ||
} | ||
}; | ||
@@ -341,0 +376,0 @@ |
{ | ||
"name": "ali-oss", | ||
"version": "4.6.2", | ||
"version": "4.6.3", | ||
"description": "aliyun oss(open storage service) node client", | ||
@@ -72,3 +72,3 @@ "main": "lib/client.js", | ||
"copy-to": "^2.0.1", | ||
"dateformat": "^1.0.12", | ||
"dateformat": "^2.0.0", | ||
"debug": "^2.2.0", | ||
@@ -84,3 +84,3 @@ "destroy": "^1.0.4", | ||
"sdk-base": "^2.0.1", | ||
"urllib": "^2.16.1", | ||
"urllib": "^2.17.1", | ||
"utility": "^1.8.0", | ||
@@ -87,0 +87,0 @@ "xml2js": "^0.4.16" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2006
72735
11
1
0
+ Addeddateformat@2.2.0(transitive)
- Removedarray-find-index@1.0.2(transitive)
- Removedcamelcase@2.1.1(transitive)
- Removedcamelcase-keys@2.1.0(transitive)
- Removedcurrently-unhandled@0.4.1(transitive)
- Removeddateformat@1.0.12(transitive)
- Removeddecamelize@1.2.0(transitive)
- Removederror-ex@1.3.2(transitive)
- Removedfind-up@1.1.2(transitive)
- Removedget-stdin@4.0.1(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedhosted-git-info@2.8.9(transitive)
- Removedindent-string@2.1.0(transitive)
- Removedis-arrayish@0.2.1(transitive)
- Removedis-core-module@2.15.1(transitive)
- Removedis-finite@1.1.0(transitive)
- Removedis-utf8@0.2.1(transitive)
- Removedload-json-file@1.1.0(transitive)
- Removedloud-rejection@1.6.0(transitive)
- Removedmap-obj@1.0.1(transitive)
- Removedmeow@3.7.0(transitive)
- Removednormalize-package-data@2.5.0(transitive)
- Removedparse-json@2.2.0(transitive)
- Removedpath-exists@2.1.0(transitive)
- Removedpath-parse@1.0.7(transitive)
- Removedpath-type@1.1.0(transitive)
- Removedpify@2.3.0(transitive)
- Removedpinkie@2.0.4(transitive)
- Removedpinkie-promise@2.0.1(transitive)
- Removedread-pkg@1.1.0(transitive)
- Removedread-pkg-up@1.0.1(transitive)
- Removedredent@1.0.0(transitive)
- Removedrepeating@2.0.1(transitive)
- Removedresolve@1.22.8(transitive)
- Removedsignal-exit@3.0.7(transitive)
- Removedspdx-correct@3.2.0(transitive)
- Removedspdx-exceptions@2.5.0(transitive)
- Removedspdx-expression-parse@3.0.1(transitive)
- Removedspdx-license-ids@3.0.20(transitive)
- Removedstrip-bom@2.0.0(transitive)
- Removedstrip-indent@1.0.1(transitive)
- Removedsupports-preserve-symlinks-flag@1.0.0(transitive)
- Removedtrim-newlines@1.0.0(transitive)
- Removedvalidate-npm-package-license@3.0.4(transitive)
Updateddateformat@^2.0.0
Updatedurllib@^2.17.1