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