graceful-fs
Advanced tools
Comparing version 4.1.15 to 4.2.0
{ | ||
"name": "graceful-fs", | ||
"description": "A drop-in replacement for fs, making various improvements.", | ||
"version": "4.1.15", | ||
"version": "4.2.0", | ||
"repository": { | ||
@@ -16,3 +16,3 @@ "type": "git", | ||
"postversion": "npm publish", | ||
"postpublish": "git push origin --all; git push origin --tags", | ||
"postpublish": "git push origin --follow-tags", | ||
"test": "node test.js | tap -" | ||
@@ -41,3 +41,3 @@ }, | ||
"rimraf": "^2.2.8", | ||
"tap": "^12.0.1" | ||
"tap": "^12.7.0" | ||
}, | ||
@@ -50,3 +50,4 @@ "files": [ | ||
"clone.js" | ||
] | ||
], | ||
"dependencies": {} | ||
} |
@@ -275,3 +275,2 @@ var constants = require('constants') | ||
function statFix (orig) { | ||
@@ -281,9 +280,16 @@ if (!orig) return orig | ||
// uid + gid. | ||
return function (target, cb) { | ||
return orig.call(fs, target, function (er, stats) { | ||
if (!stats) return cb.apply(this, arguments) | ||
if (stats.uid < 0) stats.uid += 0x100000000 | ||
if (stats.gid < 0) stats.gid += 0x100000000 | ||
return function (target, options, cb) { | ||
if (typeof options === 'function') { | ||
cb = options | ||
options = null | ||
} | ||
function callback (er, stats) { | ||
if (stats) { | ||
if (stats.uid < 0) stats.uid += 0x100000000 | ||
if (stats.gid < 0) stats.gid += 0x100000000 | ||
} | ||
if (cb) cb.apply(this, arguments) | ||
}) | ||
} | ||
return options ? orig.call(fs, target, options, callback) | ||
: orig.call(fs, target, callback) | ||
} | ||
@@ -296,4 +302,5 @@ } | ||
// uid + gid. | ||
return function (target) { | ||
var stats = orig.call(fs, target) | ||
return function (target, options) { | ||
var stats = options ? orig.call(fs, target, options) | ||
: orig.call(fs, target) | ||
if (stats.uid < 0) stats.uid += 0x100000000 | ||
@@ -300,0 +307,0 @@ if (stats.gid < 0) stats.gid += 0x100000000 |
26173
642