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 | 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 6x 6x | import globalThis from './global';
// Safely lookup if we have access to a SCRIPT element for testing module support.
const element = /** @type {any} */ (globalThis).document
? /** @type {HTMLScriptElement} */ (document.createElement('script'))
: null;
/**
* Determines if the executing environment supports modules or not.
*
* @return {Boolean} - Whether or not modules are supported.
*/
export default function hasModule() {
return Boolean(element && 'noModule' in element);
}
|