MCPcopy Create free account
hub / github.com/IgorWarzocha/howcode / updateThemeSetting

Function updateThemeSetting

desktop/runtime-host/settings-service.ts:144–154  ·  view source on GitHub ↗
(
  settingsManager: PiSettingsManager,
  value: unknown,
  projectPath?: string | null | undefined,
)

Source from the content-addressed store, hash-verified

142}
143
144async function updateThemeSetting(
145 settingsManager: PiSettingsManager,
146 value: unknown,
147 projectPath?: string | null | undefined,
148) {
149 if (typeof value !== 'string' || value.trim().length === 0) return false
150 const theme = value.trim()
151 if (!(await isKnownTheme(theme, projectPath))) throw new Error(`Unknown Pi theme: ${theme}`)
152 settingsManager.setTheme(theme)
153 return true
154}
155
156function updateTransportSetting(settingsManager: PiSettingsManager, value: unknown) {
157 const transport = asPiTransport(value)

Callers 1

updateNonBooleanSettingFunction · 0.85

Calls 1

isKnownThemeFunction · 0.85

Tested by

no test coverage detected