UNPKG
is-fn
Version:
latest (3.0.0)
3.0.0
2.0.0
1.0.0
Check if a value is a function
github.com/sindresorhus/is-fn
sindresorhus/is-fn
is-fn
/
index.js
8 lines
(6 loc)
•
220 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
export
default
function
isFunction
(
value
) {
const
type
=
Object
.
prototype
.
toString
.
call
(value);
return
type
===
'[object Function]'
||
type
===
'[object GeneratorFunction]'
||
type
===
'[object AsyncFunction]'
; }