Type isPromise

This commit is contained in:
Chocobozzz 2023-01-24 11:57:25 +01:00
parent 8ca52bcc2c
commit 841cb20243
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 2 additions and 2 deletions

View File

@ -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) {