2019-10-01 13:49:56 +00:00
|
|
|
'use strict';
|
|
|
|
module.exports = function isPromise(val) {
|
|
|
|
return (val &&
|
|
|
|
val.then &&
|
|
|
|
val.then instanceof Function &&
|
|
|
|
val.constructor &&
|
|
|
|
val.constructor.reject &&
|
|
|
|
val.constructor.reject instanceof Function &&
|
|
|
|
val.constructor.resolve &&
|
|
|
|
val.constructor.resolve instanceof Function);
|
|
|
|
};
|