odin-js-fundamentals-part-5/node_modules/@sinonjs/commons/lib/global.js

23 lines
386 B
JavaScript
Raw Permalink Normal View History

2024-01-11 08:52:05 +00:00
"use strict";
/**
* A reference to the global object
*
* @type {object} globalObject
*/
var globalObject;
/* istanbul ignore else */
if (typeof global !== "undefined") {
// Node
globalObject = global;
} else if (typeof window !== "undefined") {
// Browser
globalObject = window;
} else {
// WebWorker
globalObject = self;
}
module.exports = globalObject;