(key: string)
| 982 | } |
| 983 | |
| 984 | export function rawSettingsContainsKey(key: string): boolean { |
| 985 | for (const source of getEnabledSettingSources()) { |
| 986 | // Skip policySettings - we only care about user-configured settings |
| 987 | if (source === 'policySettings') { |
| 988 | continue |
| 989 | } |
| 990 | |
| 991 | const filePath = getSettingsFilePathForSource(source) |
| 992 | if (!filePath) { |
| 993 | continue |
| 994 | } |
| 995 | |
| 996 | try { |
| 997 | const { resolvedPath } = safeResolvePath(getFsImplementation(), filePath) |
| 998 | const content = readFileSync(resolvedPath) |
| 999 | if (!content.trim()) { |
| 1000 | continue |
| 1001 | } |
| 1002 | |
| 1003 | const rawData = safeParseJSON(content, false) |
| 1004 | if (rawData && typeof rawData === 'object' && key in rawData) { |
| 1005 | return true |
| 1006 | } |
| 1007 | } catch (error) { |
| 1008 | // File not found is expected - not all settings files exist |
| 1009 | // Other errors (permissions, I/O) should be tracked |
| 1010 | handleFileSystemError(error, filePath) |
| 1011 | } |
| 1012 | } |
| 1013 | |
| 1014 | return false |
| 1015 | } |
| 1016 |
no test coverage detected