Last change
on this file since 571e0df was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
365 bytes
|
Line | |
---|
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 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.