mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
13 lines
301 B
TypeScript
13 lines
301 B
TypeScript
export function isPromise (val: any) {
|
|
return (
|
|
val &&
|
|
val.then &&
|
|
val.then instanceof Function &&
|
|
val.constructor &&
|
|
val.constructor.reject &&
|
|
val.constructor.reject instanceof Function &&
|
|
val.constructor.resolve &&
|
|
val.constructor.resolve instanceof Function
|
|
)
|
|
}
|