MCPcopy Index your code
hub / github.com/codeaashu/claude-code / rawSettingsContainsKey

Function rawSettingsContainsKey

src/utils/settings/settings.ts:984–1015  ·  view source on GitHub ↗
(key: string)

Source from the content-addressed store, hash-verified

982}
983
984export 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

Callers 1

Calls 6

getEnabledSettingSourcesFunction · 0.85
safeResolvePathFunction · 0.85
getFsImplementationFunction · 0.85
handleFileSystemErrorFunction · 0.85
readFileSyncFunction · 0.50

Tested by

no test coverage detected