UNPKG
p-is-promise
Version:
latest (4.0.0)
4.0.0
3.0.0
2.1.0
2.0.0
1.1.0
1.0.0
Check if something is a promise
github.com/sindresorhus/p-is-promise
sindresorhus/p-is-promise
p-is-promise
/
index.d.ts
15 lines
(11 loc)
•
253 B
TypeScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/** Check if a value is a promise.
@param
value
- Value to be checked.
@example
``` import isPromise from 'p-is-promise'; isPromise(Promise.resolve('🦄')); //=> true ``` */
export
default
function
isPromise<T>(
value
:
unknown
): value is
Promise
<T>;