MCPcopy Create free account
hub / github.com/tinyplex/tinybase / getImportMap

Function getImportMap

site/ui/ExecutableProject.tsx:17–28  ·  view source on GitHub ↗
(html: string)

Source from the content-addressed store, hash-verified

15type Framework = 'none' | 'react' | 'solid' | 'svelte';
16
17const getImportMap = (html: string): {[specifier: string]: string} =>
18 Object.assign(
19 {},
20 ...(html
21 .match(IMPORT_MAP_SCRIPT_REGEX)
22 ?.map(
23 (script) =>
24 JSON.parse(
25 script.replace(/^<script\b[^>]*>/, '').replace(/<\/script>$/, ''),
26 ).imports,
27 ) ?? []),
28 );
29
30const getLess = (source: string): string =>
31 prettier.format(source, {parser: 'less'}).trim();

Callers 1

ExecutableProjectFunction · 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…