优化
This commit is contained in:
7
client/shared/utils/is-promise.ts
Normal file
7
client/shared/utils/is-promise.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export function isPromise(obj: any): obj is Promise<unknown> {
|
||||
return (
|
||||
!!obj &&
|
||||
(typeof obj === 'object' || typeof obj === 'function') &&
|
||||
typeof obj.then === 'function'
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user