(html: string)
| 36 | }; |
| 37 | |
| 38 | const getImportMap = (html: string): {[specifier: string]: string} => |
| 39 | Object.assign( |
| 40 | {}, |
| 41 | ...(html |
| 42 | .match(IMPORT_MAP_SCRIPT_REGEX) |
| 43 | ?.map( |
| 44 | (script) => |
| 45 | JSON.parse( |
| 46 | script.replace(/^<script\b[^>]*>/, '').replace(/<\/script>$/, ''), |
| 47 | ).imports, |
| 48 | ) ?? []), |
| 49 | ); |
| 50 | |
| 51 | const absolutizeImportUrl = (url: string, baseUrl: string): string => |
| 52 | /^https?:\/\//.test(url) ? url : new URL(url, baseUrl).href; |
no outgoing calls
no test coverage detected
searching dependent graphs…