mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-12 11:57:49 +00:00
Make objectToString its own helper function.
This commit is contained in:
29
lodash.js
29
lodash.js
@@ -1433,12 +1433,6 @@
|
|||||||
/** Used to detect overreaching core-js shims. */
|
/** Used to detect overreaching core-js shims. */
|
||||||
var coreJsData = context['__core-js_shared__'];
|
var coreJsData = context['__core-js_shared__'];
|
||||||
|
|
||||||
/** Used to detect methods masquerading as native. */
|
|
||||||
var maskSrcKey = (function() {
|
|
||||||
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
|
|
||||||
return uid ? ('Symbol(src)_1.' + uid) : '';
|
|
||||||
}());
|
|
||||||
|
|
||||||
/** Used to resolve the decompiled source of functions. */
|
/** Used to resolve the decompiled source of functions. */
|
||||||
var funcToString = funcProto.toString;
|
var funcToString = funcProto.toString;
|
||||||
|
|
||||||
@@ -1448,15 +1442,21 @@
|
|||||||
/** Used to generate unique IDs. */
|
/** Used to generate unique IDs. */
|
||||||
var idCounter = 0;
|
var idCounter = 0;
|
||||||
|
|
||||||
/** Used to infer the `Object` constructor. */
|
/** Used to detect methods masquerading as native. */
|
||||||
var objectCtorString = funcToString.call(Object);
|
var maskSrcKey = (function() {
|
||||||
|
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
|
||||||
|
return uid ? ('Symbol(src)_1.' + uid) : '';
|
||||||
|
}());
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to resolve the
|
* Used to resolve the
|
||||||
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
||||||
* of values.
|
* of values.
|
||||||
*/
|
*/
|
||||||
var objectToString = objectProto.toString;
|
var nativeObjectToString = objectProto.toString;
|
||||||
|
|
||||||
|
/** Used to infer the `Object` constructor. */
|
||||||
|
var objectCtorString = funcToString.call(Object);
|
||||||
|
|
||||||
/** Used to restore the original `_` reference in `_.noConflict`. */
|
/** Used to restore the original `_` reference in `_.noConflict`. */
|
||||||
var oldDash = root._;
|
var oldDash = root._;
|
||||||
@@ -6485,6 +6485,17 @@
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts `value` to a string using `Object.prototype.toString`.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {*} value The value to convert.
|
||||||
|
* @returns {string} Returns the converted string.
|
||||||
|
*/
|
||||||
|
function objectToString(value) {
|
||||||
|
return nativeObjectToString.call(value);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A specialized version of `baseRest` which transforms the rest array.
|
* A specialized version of `baseRest` which transforms the rest array.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user