is-function

is that thing a function? Use this module to find out

MIT 4 个版本
安装
npm install is-function
yarn add is-function
pnpm add is-function
bun add is-function
README

is-function

browser support

Is that thing a function? Use this module to find out.

API

module.exports = function isFunction(fn) -> Boolean

Return true if fn is a function, otherwise false.

Why not typeof fn === 'function'

Because certain old browsers misreport the type of RegExp objects as functions.

Acknowledgements

I stole this from https://github.com/ljharb/object-keys

License

MIT

版本列表
1.0.2 2020-04-22
1.0.1 2014-02-18
1.0.0 2014-01-07
0.0.0 2014-01-07