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

Function isPathTrusted

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

Source from the content-addressed store, hash-verified

750 * /assistant installing into a user-typed path).
751 */
752export function isPathTrusted(dir: string): boolean {
753 const config = getGlobalConfig()
754 let currentPath = normalizePathForConfigKey(resolve(dir))
755 while (true) {
756 if (config.projects?.[currentPath]?.hasTrustDialogAccepted) return true
757 const parentPath = normalizePathForConfigKey(resolve(currentPath, '..'))
758 if (parentPath === currentPath) return false
759 currentPath = parentPath
760 }
761}
762
763// We have to put this test code here because Jest doesn't support mocking ES modules :O
764const 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