MCPcopy Create free account
hub / github.com/Noumena-Network/code / rawSettingsContainsKey

Function rawSettingsContainsKey

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

Source from the content-addressed store, hash-verified

1069}
1070
1071export function rawSettingsContainsKey(key: string): boolean {
1072 for (const source of getEnabledSettingSources()) {
1073 // Skip policySettings - we only care about user-configured settings
1074 if (source === 'policySettings') {
1075 continue
1076 }
1077
1078 const filePath = getSettingsFilePathForSource(source)
1079 if (!filePath) {
1080 continue
1081 }
1082
1083 try {
1084 const { resolvedPath } = safeResolvePath(getFsImplementation(), filePath)
1085 const content = readFileSync(resolvedPath)
1086 if (!content.trim()) {
1087 continue
1088 }
1089
1090 const rawData = safeParseJSON(content, false)
1091 if (rawData && typeof rawData === 'object' && key in rawData) {
1092 return true
1093 }
1094 } catch (error) {
1095 // File not found is expected - not all settings files exist
1096 // Other errors (permissions, I/O) should be tracked
1097 handleFileSystemError(error, filePath)
1098 }
1099 }
1100
1101 return false
1102}

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