MCPcopy
hub / github.com/intentui/intentui / importSpecifiers

Function importSpecifiers

src/scripts/generate-registry.ts:163–170  ·  view source on GitHub ↗
(code: string)

Source from the content-addressed store, hash-verified

161}
162
163const importSpecifiers = (code: string) => {
164 const re =
165 /(?:import|export)\s+(?:[^'"]*from\s*)?["']([^"']+)["']|import\(\s*["']([^"']+)["']\s*\)/g
166 const set = new Set<string>()
167 let m
168 while ((m = re.exec(code))) set.add((m[1] || m[2]).trim())
169 return [...set]
170}
171
172const resolveLocalPath = async (fromFile: string, spec: string) => {
173 const base = path.dirname(fromFile)

Callers 8

collectBlocksFunction · 0.85
buildComponentItemFunction · 0.85
buildLibItemFunction · 0.85
buildHookItemFunction · 0.85
buildExampleItemFunction · 0.85
registryDepsForBlockFunction · 0.85
buildBlockItemFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected