is-function
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/is-function package

1.0.2 • Public • Published

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

Package Sidebar

Install

npm i is-function

Weekly Downloads

3,259,316

Version

1.0.2

License

MIT

Unpacked Size

4.3 kB

Total Files

5

Last publish

Collaborators

  • grncdr