MCPcopy Index your code
hub / github.com/tinyplex/tinybase / getImportMap

Function getImportMap

site/demo.ts:38–49  ·  view source on GitHub ↗
(html: string)

Source from the content-addressed store, hash-verified

36};
37
38const 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
51const absolutizeImportUrl = (url: string, baseUrl: string): string =>
52 /^https?:\/\//.test(url) ? url : new URL(url, baseUrl).href;

Callers 1

getDemoDocFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…