isPromise.ts 188 Bytes Edit Raw Blame History Permalink 1 2 3 export function isPromise<T>(value: any | Promise<T>): value is Promise<T> { return value && typeof (<any>value).subscribe !== 'function' && typeof (value as any).then === 'function'; }