Last change
on this file since 84d0fbb was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
792 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | var Symbol = require('./_Symbol'),
|
---|
| 2 | getRawTag = require('./_getRawTag'),
|
---|
| 3 | objectToString = require('./_objectToString');
|
---|
| 4 |
|
---|
| 5 | /** `Object#toString` result references. */
|
---|
| 6 | var nullTag = '[object Null]',
|
---|
| 7 | undefinedTag = '[object Undefined]';
|
---|
| 8 |
|
---|
| 9 | /** Built-in value references. */
|
---|
| 10 | var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
|
---|
| 11 |
|
---|
| 12 | /**
|
---|
| 13 | * The base implementation of `getTag` without fallbacks for buggy environments.
|
---|
| 14 | *
|
---|
| 15 | * @private
|
---|
| 16 | * @param {*} value The value to query.
|
---|
| 17 | * @returns {string} Returns the `toStringTag`.
|
---|
| 18 | */
|
---|
| 19 | function baseGetTag(value) {
|
---|
| 20 | if (value == null) {
|
---|
| 21 | return value === undefined ? undefinedTag : nullTag;
|
---|
| 22 | }
|
---|
| 23 | return (symToStringTag && symToStringTag in Object(value))
|
---|
| 24 | ? getRawTag(value)
|
---|
| 25 | : objectToString(value);
|
---|
| 26 | }
|
---|
| 27 |
|
---|
| 28 | module.exports = baseGetTag;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.