Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ali-oss

Package Overview
Dependencies
Maintainers
3
Versions
127
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ali-oss - npm Package Compare versions

Comparing version 4.6.2 to 4.6.3

7

History.md
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 @@ ==================

55

lib/multipart.js

@@ -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 @@

6

package.json
{
"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"

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