summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFederico Brigante <github@bfred.it>2018-04-20 11:46:41 +0700
committerGitHub <noreply@github.com>2018-04-20 11:46:41 +0700
commit673e1eec61a781cc97f4bb2406c444730f31cc85 (patch)
treea3afba4e0d7aea14550b3875c58ebffbf7a171fb
parentd08a0ac6888ec06181a23de9a43145fc1a548f37 (diff)
downloadasync-673e1eec61a781cc97f4bb2406c444730f31cc85.tar.gz
Drop isObject /2
-rw-r--r--lib/asyncify.js6
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/asyncify.js b/lib/asyncify.js
index 3f7af8b..e6d63c0 100644
--- a/lib/asyncify.js
+++ b/lib/asyncify.js
@@ -66,7 +66,7 @@ export default function asyncify(func) {
return callback(e);
}
// if result is Promise object
- if (isObject(result) && typeof result.then === 'function') {
+ if (result && typeof result.then === 'function') {
result.then(function(value) {
invokeCallback(callback, null, value);
}, function(err) {
@@ -78,10 +78,6 @@ export default function asyncify(func) {
});
}
-function isObject(value) {
- return value && (typeof value === 'object' || typeof value === 'function');
-}
-
function invokeCallback(callback, error, value) {
try {
callback(error, value);