Just got caught up using is-promise with a jQuery.Deferred as then is defined but catch is not. Since this is is-promise and not is-thenable I figured it might be a good idea to check catch as well.
return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function' && typeof obj.catch === 'function';
Just got caught up using
is-promisewith a jQuery.Deferred asthenis defined butcatchis not. Since this isis-promiseand notis-thenableI figured it might be a good idea to checkcatchas well.