(dir: string)
| 750 | * /assistant installing into a user-typed path). |
| 751 | */ |
| 752 | export 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 |
| 764 | const TEST_GLOBAL_CONFIG_FOR_TESTING: GlobalConfig = { |
nothing calls this directly
no test coverage detected