MCPcopy Index your code
hub / github.com/callstack/agent-device / isPathInside

Function isPathInside

src/io.ts:172–175  ·  view source on GitHub ↗
(filePath: string, rootDir: string)

Source from the content-addressed store, hash-verified

170}
171
172function isPathInside(filePath: string, rootDir: string): boolean {
173 const relative = path.relative(rootDir, filePath);
174 return relative === '' || (!relative.startsWith('..') && !path.isAbsolute(relative));
175}

Callers 1

resolveLocalPathFunction · 0.85

Calls 1

startsWithMethod · 0.80

Tested by

no test coverage detected