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