Version 1
[yaffs-website] / node_modules / is-function / index.js
diff --git a/node_modules/is-function/index.js b/node_modules/is-function/index.js
new file mode 100644 (file)
index 0000000..bae2183
--- /dev/null
@@ -0,0 +1,15 @@
+module.exports = isFunction
+
+var toString = Object.prototype.toString
+
+function isFunction (fn) {
+  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))
+};