All files / app/common/bundler getCurrentScriptPath.ts

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    1x       1x      
// `document.currentScript` can only be called at the global level as it only
// holds a reference to the script when it is initially processed.
const path = document.currentScript ?
    (document.currentScript as HTMLScriptElement).src :
    undefined;
 
export default function getCurrentScriptPath(): string | undefined {
    return path;
}