MCPcopy Create free account
hub / github.com/freecodexyz/free-code / isPathTrusted

Function isPathTrusted

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

Source from the content-addressed store, hash-verified

770 * /assistant installing into a user-typed path).
771 */
772export function isPathTrusted(dir: string): boolean {
773 const config = getGlobalConfig()
774 let currentPath = normalizePathForConfigKey(resolve(dir))
775 while (true) {
776 if (config.projects?.[currentPath]?.hasTrustDialogAccepted) return true
777 const parentPath = normalizePathForConfigKey(resolve(currentPath, '..'))
778 if (parentPath === currentPath) return false
779 currentPath = parentPath
780 }
781}
782
783// We have to put this test code here because Jest doesn't support mocking ES modules :O
784const 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