Promise A+规范要求obj是一个对象或者函数,这样写是否是更合理一点
liuruil opened this issue · comments
liuruil commented
Promise A+规范要求obj是一个对象或函数,这样写是否是更合理一点
address: https://promisesaplus.com/#point-53
function isPromise(obj) {
return !!(obj && (typeof obj === "object" || typeof obj === 'function') && typeof obj.then === "function");
}
Originally posted by @liuruil in #8 (comment)