MCPcopy Create free account
hub / github.com/Noumena-Network/code / isExactDirectoryPattern

Function isExactDirectoryPattern

src/utils/glob.ts:161–176  ·  view source on GitHub ↗
(
  searchPattern: string,
  searchDir: string,
)

Source from the content-addressed store, hash-verified

159}
160
161async function isExactDirectoryPattern(
162 searchPattern: string,
163 searchDir: string,
164): Promise<boolean> {
165 const normalized = normalizeGlobPattern(searchPattern).replace(/\/+$/, '')
166 if (!normalized || hasGlobCharacters(normalized)) {
167 return false
168 }
169 try {
170 const fs = getFsImplementation()
171 const stats = await fs.stat(join(searchDir, normalized))
172 return stats.isDirectory()
173 } catch {
174 return false
175 }
176}
177
178async function globDirectories(
179 searchPattern: string,

Callers 1

globFunction · 0.85

Calls 3

normalizeGlobPatternFunction · 0.85
hasGlobCharactersFunction · 0.85
getFsImplementationFunction · 0.85

Tested by

no test coverage detected