( candidate: unknown, )
| 6 | */ |
| 7 | |
| 8 | export default function isPromise<T = unknown>( |
| 9 | candidate: unknown, |
| 10 | ): candidate is PromiseLike<T> { |
| 11 | return ( |
| 12 | candidate != null && |
| 13 | (typeof candidate === 'object' || typeof candidate === 'function') && |
| 14 | typeof (candidate as any).then === 'function' |
| 15 | ); |
| 16 | } |
no outgoing calls
no test coverage detected