All files / translate global.scope.ts

50% Statements 2/4
33.33% Branches 1/3
100% Functions 0/0
50% Lines 2/4

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24                                1x 1x            
/**
 * Copyright (c) Siemens 2016 - 2025
 * SPDX-License-Identifier: MIT
 */
// global Object in a NodeJS context, which we have when building types for web-components or building with angular SSR
declare const global: any;
 
/**
 * This var provides access to the global scope object based on the current runtime.
 * On Browser its is the window, on Node.js it is global.
 *
 * Whenever possible, inject(DOCUMENT) is preferred over this approach.
 */
let globalScope: any;
 
// we are either running Browser or on NodeJS
if (typeof window !== 'undefined') {
  globalScope = window;
} else IEif (typeof global !== 'undefined') {
  globalScope = global;
}
 
export { globalScope };