diff options
author | Chocobozzz <me@florianbigard.com> | 2023-01-24 11:57:25 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-01-24 11:57:25 +0100 |
commit | 841cb202432a2abf538465f69953027973dc02aa (patch) | |
tree | c1b9188fdc41af559bc9f9fae015e81333d6b56f | |
parent | 8ca52bcc2c37d457e8b19a237c66b8dd1c00b6b9 (diff) | |
download | PeerTube-841cb202432a2abf538465f69953027973dc02aa.tar.gz PeerTube-841cb202432a2abf538465f69953027973dc02aa.tar.zst PeerTube-841cb202432a2abf538465f69953027973dc02aa.zip |
Type isPromise
-rw-r--r-- | shared/core-utils/common/promises.ts | 4 |
1 files changed, 2 insertions, 2 deletions
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 @@ | |||
1 | function isPromise (value: any) { | 1 | function isPromise <T = unknown> (value: T | Promise<T>): value is Promise<T> { |
2 | return value && typeof value.then === 'function' | 2 | return value && typeof (value as Promise<T>).then === 'function' |
3 | } | 3 | } |
4 | 4 | ||
5 | function isCatchable (value: any) { | 5 | function isCatchable (value: any) { |