mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 07:47:49 +00:00
Remove checkGlobal helper.
This commit is contained in:
15
lodash.js
15
lodash.js
@@ -361,10 +361,10 @@
|
||||
freeParseInt = parseInt;
|
||||
|
||||
/** Detect free variable `global` from Node.js. */
|
||||
var freeGlobal = checkGlobal(typeof global == 'object' && global);
|
||||
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
|
||||
|
||||
/** Detect free variable `self`. */
|
||||
var freeSelf = checkGlobal(typeof self == 'object' && self);
|
||||
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
||||
|
||||
/** Used as a reference to the global object. */
|
||||
var root = freeGlobal || freeSelf || Function('return this')();
|
||||
@@ -1014,17 +1014,6 @@
|
||||
return index;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if `value` is a global object.
|
||||
*
|
||||
* @private
|
||||
* @param {*} value The value to check.
|
||||
* @returns {null|Object} Returns `value` if it's a global object, else `null`.
|
||||
*/
|
||||
function checkGlobal(value) {
|
||||
return (value && value.Object === Object) ? value : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the number of `placeholder` occurrences in `array`.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user