diff --git a/packages/shared/src/general.ts b/packages/shared/src/general.ts index 4138b2730e6..59a1e911b6c 100644 --- a/packages/shared/src/general.ts +++ b/packages/shared/src/general.ts @@ -50,7 +50,11 @@ export const isObject = (val: unknown): val is Record => val !== null && typeof val === 'object' export const isPromise = (val: unknown): val is Promise => { - return isObject(val) && isFunction(val.then) && isFunction(val.catch) + return ( + (isObject(val) || isFunction(val)) && + isFunction(val.then) && + isFunction(val.catch) + ) } export const objectToString = Object.prototype.toString