mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 01:57:50 +00:00
Bump to v4.16.5.
This commit is contained in:
14
isSymbol.js
14
isSymbol.js
@@ -1,18 +1,8 @@
|
||||
define(['./isObjectLike'], function(isObjectLike) {
|
||||
define(['./_baseGetTag', './isObjectLike'], function(baseGetTag, isObjectLike) {
|
||||
|
||||
/** `Object#toString` result references. */
|
||||
var symbolTag = '[object Symbol]';
|
||||
|
||||
/** Used for built-in method references. */
|
||||
var objectProto = Object.prototype;
|
||||
|
||||
/**
|
||||
* Used to resolve the
|
||||
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
||||
* of values.
|
||||
*/
|
||||
var objectToString = objectProto.toString;
|
||||
|
||||
/**
|
||||
* Checks if `value` is classified as a `Symbol` primitive or object.
|
||||
*
|
||||
@@ -32,7 +22,7 @@ define(['./isObjectLike'], function(isObjectLike) {
|
||||
*/
|
||||
function isSymbol(value) {
|
||||
return typeof value == 'symbol' ||
|
||||
(isObjectLike(value) && objectToString.call(value) == symbolTag);
|
||||
(isObjectLike(value) && baseGetTag(value) == symbolTag);
|
||||
}
|
||||
|
||||
return isSymbol;
|
||||
|
||||
Reference in New Issue
Block a user