Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

isPromise.ts 365B

12345678
  1. /**
  2. * Tests to see if the object is an ES2015 (ES6) Promise
  3. * @see {@link https://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects}
  4. * @param value the object to test
  5. */
  6. export function isPromise(value: any): value is PromiseLike<any> {
  7. return !!value && typeof (<any>value).subscribe !== 'function' && typeof (value as any).then === 'function';
  8. }