Commit 609aadad authored by Avi's avatar Avi

Fixed logic in if/else for checking functions

parent d243b11d
Pipeline #17475 failed with stages
in 2 minutes and 7 seconds
......@@ -5,8 +5,7 @@ var promisify = (
) => {
GioType[`original_${asyncStuff}`] = GioType[asyncStuff];
GioType[asyncStuff] = function(...args) {
if (args.every(arg=>typeof arg === 'function')) return;
else return new Promise((resolve, reject)=>{
if (args.every(arg=>typeof arg !== 'function')) return new Promise((resolve, reject)=>{
this[`original_${asyncStuff}`](...args, function(source, res) {
try {
let result = source[finishStuff](res);
......@@ -17,5 +16,6 @@ var promisify = (
});
});
else return this[`original_${asyncStuff}`](...args);
};
};
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment