aboutsummaryrefslogtreecommitdiff
path: root/node_modules/lodash/isBoolean.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/lodash/isBoolean.js')
-rw-r--r--node_modules/lodash/isBoolean.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/node_modules/lodash/isBoolean.js b/node_modules/lodash/isBoolean.js
new file mode 100644
index 0000000..a43ed4b
--- /dev/null
+++ b/node_modules/lodash/isBoolean.js
@@ -0,0 +1,29 @@
+var baseGetTag = require('./_baseGetTag'),
+ isObjectLike = require('./isObjectLike');
+
+/** `Object#toString` result references. */
+var boolTag = '[object Boolean]';
+
+/**
+ * Checks if `value` is classified as a boolean primitive or object.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
+ * @example
+ *
+ * _.isBoolean(false);
+ * // => true
+ *
+ * _.isBoolean(null);
+ * // => false
+ */
+function isBoolean(value) {
+ return value === true || value === false ||
+ (isObjectLike(value) && baseGetTag(value) == boolTag);
+}
+
+module.exports = isBoolean;