MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / isPathInsideDirectory

Function isPathInsideDirectory

src/services/rules/rules.ts:382–385  ·  view source on GitHub ↗
(filePath: string, directoryPath: string)

Source from the content-addressed store, hash-verified

380}
381
382function isPathInsideDirectory(filePath: string, directoryPath: string): boolean {
383 const relativePath = path.relative(directoryPath, filePath)
384 return relativePath !== "" && !relativePath.startsWith("..") && !path.isAbsolute(relativePath)
385}
386
387function createRuleId(scope: RuleScope, kind: RuleKind, modeSlug: string | undefined, relativePath: string): string {
388 return [scope, kind, modeSlug ?? "generic", relativePath].join(":")

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected