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

Function getDirectoryGlobMaxDepth

src/utils/glob.ts:136–145  ·  view source on GitHub ↗
(pattern: string)

Source from the content-addressed store, hash-verified

134}
135
136function getDirectoryGlobMaxDepth(pattern: string): number {
137 const normalized = normalizeGlobPattern(pattern).replace(/\/+$/, '')
138 if (normalized.includes('**')) {
139 return Number.POSITIVE_INFINITY
140 }
141 if (!normalized) {
142 return 0
143 }
144 return normalized.split('/').filter(Boolean).length
145}
146
147function hasGlobCharacters(pattern: string): boolean {
148 return /[*?[{]/.test(pattern)

Callers 1

globDirectoriesFunction · 0.85

Calls 1

normalizeGlobPatternFunction · 0.85

Tested by

no test coverage detected