diff --git a/lib/file.js b/lib/file.js index e34c10e4..01f3a895 100644 --- a/lib/file.js +++ b/lib/file.js @@ -35,7 +35,7 @@ File.prototype.open = function() { }; File.prototype.toJSON = function() { - return { + var json = { size: this.size, path: this.path, name: this.name, @@ -45,6 +45,10 @@ File.prototype.toJSON = function() { filename: this.filename, mime: this.mime }; + if (this.hash && this.hash != "") { + json.hash = this.hash; + } + return json; }; File.prototype.write = function(buffer, cb) {