PageRenderTime 16ms CodeModel.GetById 8ms app.highlight 3ms RepoModel.GetById 2ms app.codeStats 0ms

/node_modules/lodash/isSymbol.js

https://bitbucket.org/coleman333/smartsite
JavaScript | 29 lines | 8 code | 3 blank | 18 comment | 3 complexity | 963f2dbaf63c3e402996ed304161ed00 MD5 | raw file
 1var baseGetTag = require('./_baseGetTag'),
 2    isObjectLike = require('./isObjectLike');
 3
 4/** `Object#toString` result references. */
 5var symbolTag = '[object Symbol]';
 6
 7/**
 8 * Checks if `value` is classified as a `Symbol` primitive or object.
 9 *
10 * @static
11 * @memberOf _
12 * @since 4.0.0
13 * @category Lang
14 * @param {*} value The value to check.
15 * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
16 * @example
17 *
18 * _.isSymbol(Symbol.iterator);
19 * // => true
20 *
21 * _.isSymbol('abc');
22 * // => false
23 */
24function isSymbol(value) {
25  return typeof value == 'symbol' ||
26    (isObjectLike(value) && baseGetTag(value) == symbolTag);
27}
28
29module.exports = isSymbol;