Sha256: 369c0d8cbe0c5ea2db4c24bb1c7f818ce0d849d2956d133c3da08f6096763c13

Contents?: true

Size: 897 Bytes

Versions: 12

Compression:

Stored size: 897 Bytes

Contents

var classofRaw = require('../internals/classof-raw');
var wellKnownSymbol = require('../internals/well-known-symbol');

var TO_STRING_TAG = wellKnownSymbol('toStringTag');
// ES3 wrong here
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';

// fallback for IE11 Script Access Denied error
var tryGet = function (it, key) {
  try {
    return it[key];
  } catch (error) { /* empty */ }
};

// getting tag from ES6+ `Object.prototype.toString`
module.exports = function (it) {
  var O, tag, result;
  return it === undefined ? 'Undefined' : it === null ? 'Null'
    // @@toStringTag case
    : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag
    // builtinTag case
    : CORRECT_ARGUMENTS ? classofRaw(O)
    // ES3 arguments fallback
    : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
};

Version data entries

12 entries across 12 versions & 4 rubygems

Version Path
disco_app-0.18.0 test/dummy/node_modules/core-js/internals/classof.js
disco_app-0.18.2 test/dummy/node_modules/core-js/internals/classof.js
condenser-0.0.8 lib/condenser/processors/node_modules/core-js-pure/internals/classof.js
jester-data-8.0.0 node_modules/core-js/internals/classof.js
ezii-os-5.2.1 node_modules/core-js/internals/classof.js
ezii-os-2.0.1 node_modules/core-js/internals/classof.js
ezii-os-1.1.0 node_modules/core-js/internals/classof.js
ezii-os-1.0.0 node_modules/core-js/internals/classof.js
condenser-0.0.7 lib/condenser/processors/node_modules/core-js-pure/internals/classof.js
ezii-os-0.0.0.1.0 node_modules/core-js/internals/classof.js
ezii-os-0.0.0.0.1 node_modules/core-js/internals/classof.js
condenser-0.0.5 lib/condenser/processors/node_modules/core-js-pure/internals/classof.js