MCPcopy Create free account
hub / github.com/21st-dev/21st-sdk / includePath

Function includePath

apps/agents-web/lib/server/github/github-reference.ts:98–115  ·  view source on GitHub ↗
(p: string)

Source from the content-addressed store, hash-verified

96 const SKIP_DIRS = ["node_modules", ".git", "dist", "build", ".next"]
97
98 const includePath = (p: string) => {
99 // Must be under any selected folder
100 let under = false
101 for (const prefix of selectedPrefixes) {
102 if (p === prefix || p.startsWith(prefix + "/")) {
103 under = true
104 break
105 }
106 }
107 if (!under) return false
108
109 // Skip ignored directories
110 const parts = p.split("/")
111 for (const part of parts) {
112 if (SKIP_DIRS.includes(part)) return false
113 }
114 return true
115 }
116
117 const dirs = new Set<string>()
118 const files: string[] = []

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected