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

6 lines
165 B
JavaScript

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