(object: any)
| 737 | */ |
| 738 | // tslint:disable-next-line: no-any |
| 739 | export function isPromise(object: any): object is Promise<unknown> { |
| 740 | // We chose to not use 'obj instanceOf Promise' for two reasons: |
| 741 | // 1. It only reliably works for es6 Promise, not other Promise |
| 742 | // implementations. |
| 743 | // 2. It doesn't work with framework that uses zone.js. zone.js monkey |
| 744 | // patch the async calls, so it is possible the obj (patched) is |
| 745 | // comparing to a pre-patched Promise. |
| 746 | return object && object.then && typeof object.then === 'function'; |
| 747 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…