feat(facade): add support for all thenables (#10278)
All objects that have a then function will be considered Promises
This commit is contained in:

committed by
Victor Berchet

parent
9d9e9c6ff1
commit
58d9e7fc5a
@ -133,7 +133,9 @@ export function isStrictStringMap(obj: any): boolean {
|
||||
}
|
||||
|
||||
export function isPromise(obj: any): boolean {
|
||||
return obj instanceof (<any>_global).Promise;
|
||||
// allow any Promise/A+ compliant thenable.
|
||||
// It's up to the caller to ensure that obj.then conforms to the spec
|
||||
return isPresent(obj) && isFunction(obj.then);
|
||||
}
|
||||
|
||||
export function isArray(obj: any): boolean {
|
||||
|
Reference in New Issue
Block a user