isPromise

1 function isPromise(obj) {
2     return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
3 }

 

posted @ 2020-06-11 11:26  xlsdg  阅读(228)  评论(0)    收藏  举报