aboutsummaryrefslogtreecommitdiff
path: root/node_modules/lodash/_castFunction.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/lodash/_castFunction.js')
-rw-r--r--node_modules/lodash/_castFunction.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/node_modules/lodash/_castFunction.js b/node_modules/lodash/_castFunction.js
new file mode 100644
index 0000000..98c91ae
--- /dev/null
+++ b/node_modules/lodash/_castFunction.js
@@ -0,0 +1,14 @@
+var identity = require('./identity');
+
+/**
+ * Casts `value` to `identity` if it's not a function.
+ *
+ * @private
+ * @param {*} value The value to inspect.
+ * @returns {Function} Returns cast function.
+ */
+function castFunction(value) {
+ return typeof value == 'function' ? value : identity;
+}
+
+module.exports = castFunction;