thenify-all
Advanced tools
Comparing version 1.0.0 to 1.1.0
14
index.js
@@ -5,2 +5,16 @@ | ||
module.exports = function (source, destination, methods) { | ||
if (!destination) { | ||
destination = {}; | ||
methods = Object.keys(source) | ||
} | ||
if (Array.isArray(destination)) { | ||
methods = destination | ||
destination = {} | ||
} | ||
if (!methods) { | ||
methods = Object.keys(source) | ||
} | ||
methods.forEach(function (name) { | ||
@@ -7,0 +21,0 @@ // promisify only if it's a function |
{ | ||
"name": "thenify-all", | ||
"description": "Promisifies all the selected functions in an object", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"author": "Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)", | ||
@@ -12,9 +12,10 @@ "license": "MIT", | ||
"devDependencies": { | ||
"mocha": "2", | ||
"istanbul": "0" | ||
"bluebird": "2", | ||
"istanbul": "0", | ||
"mocha": "2" | ||
}, | ||
"scripts": { | ||
"test": "mocha --reporter spec", | ||
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot", | ||
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot" | ||
"test-cov": "istanbul cover node_modules/.bin/_mocha -- --reporter dot", | ||
"test-travis": "istanbul cover node_modules/.bin/_mocha --report lcovonly -- --reporter dot" | ||
}, | ||
@@ -28,3 +29,5 @@ "keywords": [ | ||
], | ||
"files": ["index.js"] | ||
"files": [ | ||
"index.js" | ||
] | ||
} |
@@ -29,3 +29,3 @@ | ||
### var obj = thenify(source, obj, methods) | ||
### var obj = thenify(source, [obj], [methods]) | ||
@@ -32,0 +32,0 @@ - `source` - the source object for the async functions |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4537
24
3