checkGlobal.js 305 B

123456789101112
  1. /**
  2. * Checks if `value` is a global object.
  3. *
  4. * @private
  5. * @param {*} value The value to check.
  6. * @returns {null|Object} Returns `value` if it's a global object, else `null`.
  7. */
  8. function checkGlobal(value) {
  9. return (value && value.Object === Object) ? value : null;
  10. }
  11. export default checkGlobal;