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

Function assertPathInsideDirectory

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

Source from the content-addressed store, hash-verified

363}
364
365function assertPathInsideDirectory(filePath: string, directoryPath: string): void {
366 if (!isPathInsideDirectory(path.resolve(filePath), path.resolve(directoryPath))) {
367 throw new Error("Rule path must stay inside the rules directory")
368 }
369}
370
371async function assertRealPathInsideDirectory(filePath: string, directoryPath: string): Promise<void> {
372 if (!(await isRealPathInsideDirectory(filePath, directoryPath))) {

Callers 2

createRuleFunction · 0.85
resolveRuleFileFunction · 0.85

Calls 1

isPathInsideDirectoryFunction · 0.85

Tested by

no test coverage detected