MCPcopy Create free account
hub / github.com/claude-code-best/claude-code / rawSettingsContainsKey

Function rawSettingsContainsKey

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

Source from the content-addressed store, hash-verified

970}
971
972export function rawSettingsContainsKey(key: string): boolean {
973 for (const source of getEnabledSettingSources()) {
974 // Skip policySettings - we only care about user-configured settings
975 if (source === 'policySettings') {
976 continue
977 }
978
979 const filePath = getSettingsFilePathForSource(source)
980 if (!filePath) {
981 continue
982 }
983
984 try {
985 const { resolvedPath } = safeResolvePath(getFsImplementation(), filePath)
986 const content = readFileSync(resolvedPath)
987 if (!content.trim()) {
988 continue
989 }
990
991 const rawData = safeParseJSON(content, false)
992 if (rawData && typeof rawData === 'object' && key in rawData) {
993 return true
994 }
995 } catch (error) {
996 // File not found is expected - not all settings files exist
997 // Other errors (permissions, I/O) should be tracked
998 handleFileSystemError(error, filePath)
999 }
1000 }
1001
1002 return false
1003}

Callers 1

Calls 7

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

Tested by

no test coverage detected