1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 17:59:55 +02:00
Oinktube/node_modules/is-function/index.js
2022-03-17 11:43:59 -03:00

18 lines
478 B
JavaScript

module.exports = isFunction
var toString = Object.prototype.toString
function isFunction (fn) {
if (!fn) {
return false
}
var string = toString.call(fn)
return string === '[object Function]' ||
(typeof fn === 'function' && string !== '[object RegExp]') ||
(typeof window !== 'undefined' &&
// IE8 and below
(fn === window.setTimeout ||
fn === window.alert ||
fn === window.confirm ||
fn === window.prompt))
};