({type}: HTMLScriptElement)
| 30 | ]; |
| 31 | |
| 32 | export function isJavaScript({type}: HTMLScriptElement): boolean { |
| 33 | if (!type) return true; |
| 34 | type = type.toLowerCase(); |
| 35 | return type === "text/javascript" || type === "application/javascript" || type === "module"; |
| 36 | } |
| 37 | |
| 38 | export function parseHtml(html: string): DOMWindow { |
| 39 | return new JSDOM(`<!DOCTYPE html><body>${html}`, {virtualConsole: new VirtualConsole()}).window; |
no outgoing calls
no test coverage detected