You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This particular method is deprecated: "Stability: 0 - Deprecated: Use fs.stat() or fs.access() instead." But I think we can resolve this in nodegit-promise denodeify method.
diff --git a/src/node-extensions.js b/src/node-extensions.js
index 6ca7518..389e312 100644
--- a/src/node-extensions.js+++ b/src/node-extensions.js@@ -17,8 +17,14 @@ Promise.denodeify = function (fn, argumentCount) {
var args = Array.prototype.slice.call(arguments, 0,
argumentCount > 0 ? argumentCount : 0);
return new Promise(function (resolve, reject) {
- args.push(function (err, res) {- if (err) reject(err);+ args.push(function () {+ const [err, res] = arguments;+ // If only one argument is returned (err) then return that value.+ // fs.exists('', fileExists => console.log(fileExists));+ if (arguments.length === 1) {+ resolve(err);+ }+ else if (err) reject(err);
else resolve(res);
})
var res = fn.apply(self, args);
result:
The text was updated successfully, but these errors were encountered: