odin-javascript-exercises/node_modules/is-promise/index.js
2017-12-15 12:56:14 -06:00

5 lines
165 B
JavaScript

module.exports = isPromise;
function isPromise(obj) {
return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
}