2 * lodash 3.0.1 (Custom Build) <https://lodash.com/>
3 * Build: `lodash modularize exports="npm" -o ./`
4 * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
5 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
6 * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
7 * Available under MIT license <https://lodash.com/license>
10 /** Used to determine if values are of the language type `Object`. */
16 /** Detect free variable `exports`. */
17 var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType)
21 /** Detect free variable `module`. */
22 var freeModule = (objectTypes[typeof module] && module && !module.nodeType)
26 /** Detect free variable `global` from Node.js. */
27 var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global);
29 /** Detect free variable `self`. */
30 var freeSelf = checkGlobal(objectTypes[typeof self] && self);
32 /** Detect free variable `window`. */
33 var freeWindow = checkGlobal(objectTypes[typeof window] && window);
35 /** Detect `this` as the global object. */
36 var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
39 * Used as a reference to the global object.
41 * The `this` value is used if it's the global object to avoid Greasemonkey's
42 * restricted `window` object, otherwise the `window` object is used.
44 var root = freeGlobal ||
45 ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) ||
46 freeSelf || thisGlobal || Function('return this')();
49 * Checks if `value` is a global object.
52 * @param {*} value The value to check.
53 * @returns {null|Object} Returns `value` if it's a global object, else `null`.
55 function checkGlobal(value) {
56 return (value && value.Object === Object) ? value : null;
59 module.exports = root;