From 2b8a8def087206d76cd70408949419bf20a99955 Mon Sep 17 00:00:00 2001 From: Adam Bradley Date: Fri, 28 Aug 2020 12:41:06 -0500 Subject: [PATCH] chore(util): add to isPromise --- src/utils/helpers.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/helpers.ts b/src/utils/helpers.ts index ff9b8a40483..00955ad2f6d 100644 --- a/src/utils/helpers.ts +++ b/src/utils/helpers.ts @@ -88,4 +88,5 @@ export const isNumber = (v: any): v is boolean => typeof v === 'number'; export const isObject = (val: Object) => val != null && typeof val === 'object' && Array.isArray(val) === false; export const isString = (v: any): v is string => typeof v === 'string'; export const isIterable = (v: any): v is Iterable => isDefined(v) && isFunction(v[Symbol.iterator]); -export const isPromise = (v: any): v is Promise => !!v && (typeof v === 'object' || typeof v === 'function') && typeof v.then === 'function'; +export const isPromise = (v: any): v is Promise => + !!v && (typeof v === 'object' || typeof v === 'function') && typeof v.then === 'function';