@ -524,6 +524,10 @@
isWindow: function (obj) {
return obj != null && obj == obj.window;
},
isPromise: function(obj) {
return !!obj && (BI.isObject(obj) || BI.isFunction(obj)) && BI.isFunction(obj.then);
}
});
@ -376,6 +376,12 @@ export interface _base {
getDate: (...args: (number | string)[]) => Date;
getTime: (...args: any[]) => number;
/**
* 判断一个对象是不是promise
* @param obj 对象
*/
isPromise: (obj: any) => obj is Promise<any>;
type merge = {