index.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /**
  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>
  8. */
  9. /** Used to determine if values are of the language type `Object`. */
  10. var objectTypes = {
  11. 'function': true,
  12. 'object': true
  13. };
  14. /** Detect free variable `exports`. */
  15. var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType)
  16. ? exports
  17. : undefined;
  18. /** Detect free variable `module`. */
  19. var freeModule = (objectTypes[typeof module] && module && !module.nodeType)
  20. ? module
  21. : undefined;
  22. /** Detect free variable `global` from Node.js. */
  23. var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global);
  24. /** Detect free variable `self`. */
  25. var freeSelf = checkGlobal(objectTypes[typeof self] && self);
  26. /** Detect free variable `window`. */
  27. var freeWindow = checkGlobal(objectTypes[typeof window] && window);
  28. /** Detect `this` as the global object. */
  29. var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
  30. /**
  31. * Used as a reference to the global object.
  32. *
  33. * The `this` value is used if it's the global object to avoid Greasemonkey's
  34. * restricted `window` object, otherwise the `window` object is used.
  35. */
  36. var root = freeGlobal ||
  37. ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) ||
  38. freeSelf || thisGlobal || Function('return this')();
  39. /**
  40. * Checks if `value` is a global object.
  41. *
  42. * @private
  43. * @param {*} value The value to check.
  44. * @returns {null|Object} Returns `value` if it's a global object, else `null`.
  45. */
  46. function checkGlobal(value) {
  47. return (value && value.Object === Object) ? value : null;
  48. }
  49. module.exports = root;