MCPcopy Create free account
hub / github.com/tiann/hapi / isWithinWorkspaceRoots

Method isWithinWorkspaceRoots

cli/src/api/apiMachine.ts:211–217  ·  view source on GitHub ↗
(absolutePath: string)

Source from the content-addressed store, hash-verified

209 }
210
211 private isWithinWorkspaceRoots(absolutePath: string): boolean {
212 if (!this.normalizedWorkspaceRoots?.length) return true
213 return this.normalizedWorkspaceRoots.some((workspaceRoot) => {
214 const rel = relative(workspaceRoot, absolutePath)
215 return rel === '' || (!rel.startsWith('..') && !isAbsolute(rel))
216 })
217 }
218
219 /**
220 * Canonicalize a path for workspace-root containment checks. Resolves

Callers 2

constructorMethod · 0.95
setRPCHandlersMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected