2018-08-24 18:09:42 +02:00

6 lines
165 B
JavaScript

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