MCPcopy Index your code
hub / github.com/claude-code-best/claude-code / isPathTrusted

Function isPathTrusted

src/utils/config.ts:760–769  ·  view source on GitHub ↗
(dir: string)

Source from the content-addressed store, hash-verified

758 * /assistant installing into a user-typed path).
759 */
760export function isPathTrusted(dir: string): boolean {
761 const config = getGlobalConfig()
762 let currentPath = normalizePathForConfigKey(resolve(dir))
763 while (true) {
764 if (config.projects?.[currentPath]?.hasTrustDialogAccepted) return true
765 const parentPath = normalizePathForConfigKey(resolve(currentPath, '..'))
766 if (parentPath === currentPath) return false
767 currentPath = parentPath
768 }
769}
770
771// We have to put this test code here because Jest doesn't support mocking ES modules :O
772const TEST_GLOBAL_CONFIG_FOR_TESTING: GlobalConfig = {

Callers

nothing calls this directly

Calls 3

getGlobalConfigFunction · 0.85
resolveFunction · 0.70

Tested by

no test coverage detected