UNPKG

@planjs/utils

Version:

🔧 Common tools collection

12 lines (10 loc) 280 B
import _typeof from "@babel/runtime/helpers/esm/typeof"; /** * 是否为promise * @param obj * @category Is */ function isPromise(obj) { return !!obj && (_typeof(obj) === 'object' || typeof obj === 'function') && typeof obj.then === 'function'; } export default isPromise;