odin-javascript-exercises/node_modules/is-promise/index.js

6 lines
165 B
JavaScript
Raw Normal View History

2017-12-15 10:56:14 -08:00
module.exports = isPromise;
function isPromise(obj) {
return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
}