MCPcopy Create free account
hub / github.com/amaancoderx/npxskillui / hasCSSModules

Function hasCSSModules

src/extractors/framework.ts:64–81  ·  view source on GitHub ↗
(dir: string, depth = 0)

Source from the content-addressed store, hash-verified

62}
63
64function hasCSSModules(dir: string, depth = 0): boolean {
65 if (depth > 4) return false;
66 try {
67 const entries = fs.readdirSync(dir, { withFileTypes: true });
68 for (const entry of entries) {
69 if (entry.name === 'node_modules' || entry.name === '.git') continue;
70 if (entry.isFile() && /\.module\.(css|scss|less)$/.test(entry.name)) {
71 return true;
72 }
73 if (entry.isDirectory() && depth < 4) {
74 if (hasCSSModules(path.join(dir, entry.name), depth + 1)) return true;
75 }
76 }
77 } catch {
78 // Permission errors etc.
79 }
80 return false;
81}
82
83export function getProjectName(projectDir: string, overrideName?: string): string {
84 if (overrideName) return overrideName;

Callers 1

detectFrameworksFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected