Comparing version 1.0.1 to 1.0.2
29
index.js
@@ -1,17 +0,14 @@ | ||
module.exports = function(fn){ | ||
return function(obj, cb){ | ||
if(cb && cb instanceof Function){ | ||
fn(obj, cb); | ||
} else { | ||
return new Promise((resolve, reject) => { | ||
fn(obj, (err, res) => { | ||
if(err){ | ||
reject(err); | ||
} else { | ||
resolve(res); | ||
} | ||
}); | ||
}); | ||
} | ||
}; | ||
module.exports = fn => (obj, cb) => { | ||
if(cb && cb instanceof Function){ | ||
return fn(obj, cb); | ||
} | ||
return new Promise((resolve, reject) => { | ||
fn(obj, (err, res) => { | ||
if(err){ | ||
reject(err); | ||
} else { | ||
resolve(res); | ||
} | ||
}); | ||
}); | ||
}; |
{ | ||
"name": "promy", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Conditional promisify", | ||
@@ -19,4 +19,4 @@ "main": "index.js", | ||
"ava": "^0.25.0", | ||
"eslint": "^4.19.1", | ||
"eslint-config-astur": "0.0.2", | ||
"eslint": "^5.4.0", | ||
"eslint-config-astur": "^1.6.1", | ||
"nyc": "^12.0.2" | ||
@@ -23,0 +23,0 @@ }, |
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
3888
38