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