From 841cb202432a2abf538465f69953027973dc02aa Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 24 Jan 2023 11:57:25 +0100 Subject: Type isPromise --- shared/core-utils/common/promises.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'shared/core-utils/common/promises.ts') diff --git a/shared/core-utils/common/promises.ts b/shared/core-utils/common/promises.ts index dc0db9074..f17221b97 100644 --- a/shared/core-utils/common/promises.ts +++ b/shared/core-utils/common/promises.ts @@ -1,5 +1,5 @@ -function isPromise (value: any) { - return value && typeof value.then === 'function' +function isPromise (value: T | Promise): value is Promise { + return value && typeof (value as Promise).then === 'function' } function isCatchable (value: any) { -- cgit v1.2.3