is-symbol.js 493 B

12345678910111213
  1. var getBuiltIn = require('../internals/get-built-in');
  2. var isCallable = require('../internals/is-callable');
  3. var isPrototypeOf = require('../internals/object-is-prototype-of');
  4. var USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');
  5. var $Object = Object;
  6. module.exports = USE_SYMBOL_AS_UID ? function (it) {
  7. return typeof it == 'symbol';
  8. } : function (it) {
  9. var $Symbol = getBuiltIn('Symbol');
  10. return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));
  11. };