Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Type isPromise

Chocobozzz841cb202432a
diff --git a/shared/core-utils/common/promises.ts b/shared/core-utils/common/promises.ts
index dc0db90748..f17221b97f 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 <T = unknown> (value: T | Promise<T>): value is Promise<T> {
+ return value && typeof (value as Promise<T>).then === 'function'
}
function isCatchable (value: any) {