Created
November 30, 2020 21:02
-
-
Save nblackburn/a87c5187018dd511872638fbfd70ec72 to your computer and use it in GitHub Desktop.
Check if a value is a promise or not
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = (value) => { | |
return value && typeof value.then === 'function' && typeof value.catch === 'function'; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment