MCPcopy
hub / github.com/axios/axios / getGlobal

Function getGlobal

lib/utils.js:302–308  ·  view source on GitHub ↗

* Determine if a value is a FormData * * @param {*} thing The value to test * * @returns {boolean} True if value is an FormData, otherwise false

()

Source from the content-addressed store, hash-verified

300 * @returns {boolean} True if value is an FormData, otherwise false
301 */
302function getGlobal() {
303 if (typeof globalThis !== 'undefined') return globalThis;
304 if (typeof self !== 'undefined') return self;
305 if (typeof window !== 'undefined') return window;
306 if (typeof global !== 'undefined') return global;
307 return {};
308}
309
310const G = getGlobal();
311const FormDataCtor = typeof G.FormData !== 'undefined' ? G.FormData : undefined;

Callers 1

utils.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected