@bhoos/promisify
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -10,4 +10,6 @@ 'use strict'; | ||
exports.default = function (a) { | ||
var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : a; | ||
if (typeof a === 'function') { | ||
return promisify(a); | ||
return promisify(a, context); | ||
} else if ((typeof a === 'undefined' ? 'undefined' : _typeof(a)) === 'object') { | ||
@@ -41,3 +43,4 @@ return promisifyAll(a); | ||
var res = {}; | ||
Object.keys(obj).forEach(function (key) { | ||
// eslint-disable-next-line | ||
for (var key in obj) { | ||
var fn = obj[key]; | ||
@@ -47,4 +50,4 @@ if (typeof fn === 'function') { | ||
} | ||
}); | ||
} | ||
return res; | ||
} |
{ | ||
"name": "@bhoos/promisify", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Simple library to promisify call-back based functions", | ||
@@ -5,0 +5,0 @@ "main": "cjs/index.js", |
2511
40