MCPcopy Create free account
hub / github.com/DarkInventor/easy-ui / extractComponentsFromImport

Function extractComponentsFromImport

scripts/build.ts:266–282  ·  view source on GitHub ↗
(importStatement: string)

Source from the content-addressed store, hash-verified

264}
265
266function extractComponentsFromImport(importStatement: string): string[] {
267 const components: string[] = [];
268 const namedImportRegex = /{([^}]+)}/;
269 const match = importStatement.match(namedImportRegex);
270
271 if (match) {
272 components.push(...match[1].split(',').map(c => c.trim()));
273 } else {
274 const defaultImportRegex = /import\s+(\w+)/;
275 const defaultMatch = importStatement.match(defaultImportRegex);
276 if (defaultMatch) {
277 components.push(defaultMatch[1]);
278 }
279 }
280
281 return components;
282}
283
284function extractCssVars(content: string): Schema['cssVars'] {
285 const cssVarsRegex = /\/\/ @cssVars: (\{.*\})/;

Callers 1

extractDependenciesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected