tus
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -139,7 +139,8 @@ var fs = require('fs'), | ||
req.on('error', reject); | ||
stream.on('error', reject); | ||
}).finally(function() { | ||
stream.close(); | ||
stream.end(); | ||
}), | ||
new Promise(function(resolve) { | ||
stream.on('close', resolve); | ||
stream.on('finish', resolve); | ||
}).then(function() { | ||
@@ -151,3 +152,3 @@ return getInfo(id).then(function(info) { | ||
var promise = writeFile(options.directory + "/" + id + ".info", JSON.stringify(info), "utf8"); | ||
if (typeof options.complete === "function") { | ||
if (typeof options.complete === "function" && info.offset >= info.entityLength) { | ||
options.complete(info); | ||
@@ -154,0 +155,0 @@ } |
{ | ||
"name": "tus", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Node.js resumable upload middleware for express/connect", | ||
@@ -5,0 +5,0 @@ "main": "lib/tus.js", |
Sorry, the diff of this file is not supported yet
59343
186