apr-asyncify
Advanced tools
Comparing version 1.0.3 to 1.0.4
19
index.js
@@ -26,12 +26,9 @@ /** | ||
*/ | ||
module.exports = (fn) => { | ||
return (...args) => { | ||
return new Promise((resolve, reject) => { | ||
try { | ||
resolve(fn(...args)); | ||
} catch (err) { | ||
reject(err); | ||
} | ||
}); | ||
}; | ||
}; | ||
module.exports = fn => (...args) => | ||
new Promise((resolve, reject) => { | ||
try { | ||
resolve(fn(...args)); | ||
} catch (err) { | ||
reject(err); | ||
} | ||
}); |
{ | ||
"name": "apr-asyncify", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Take a sync function and make it async. This is useful for plugging sync functions into a waterfall, series, or other async functions.", | ||
@@ -13,5 +13,13 @@ "keywords": [ | ||
"control-flow", | ||
"awaitful" | ||
"awaitful", | ||
"promises", | ||
"async-await", | ||
"es2015", | ||
"es2016", | ||
"es2017", | ||
"es6", | ||
"es7", | ||
"es8" | ||
], | ||
"homepage": "https://ramitos.github.io/apr#asyncify", | ||
"homepage": "https://apr.js.org#asyncify", | ||
"bugs": "https://github.com/ramitos/apr/issues", | ||
@@ -18,0 +26,0 @@ "license": "MIT", |
@@ -12,2 +12,3 @@ <!-- Generated by documentation.js. Update this documentation by updating the source code. --> | ||
- `fn` | ||
- `function` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** | ||
@@ -14,0 +15,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
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
2952
0
33
33