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

Function getThemeEntries

desktop/runtime-host/theme-service.ts:109–124  ·  view source on GitHub ↗
(
  bundledThemeEntries: ReturnType<typeof getBundledThemes>,
  themesResult: DiscoveredThemesResult,
)

Source from the content-addressed store, hash-verified

107}
108
109function getThemeEntries(
110 bundledThemeEntries: ReturnType<typeof getBundledThemes>,
111 themesResult: DiscoveredThemesResult,
112): PiThemeState['themes'] {
113 return [
114 ...bundledThemeEntries,
115 { name: 'dark', label: 'Pi dark', source: 'pi-builtin' as const },
116 { name: 'light', label: 'Pi light', source: 'pi-builtin' as const },
117 ...themesResult.themes.map((theme) => ({
118 name: theme.name ?? 'unnamed',
119 label: theme.name ?? 'Unnamed Pi theme',
120 source: 'pi-json' as const,
121 path: theme.sourcePath,
122 })),
123 ].filter((theme, index, themes) => themes.findIndex((item) => item.name === theme.name) === index)
124}
125
126function loadBundledThemes(loadThemeFromPath: (themePath: string) => unknown): LoadedBundledThemes {
127 const entries: LoadedBundledThemes['entries'] = []

Callers 1

loadPiThemeStateInHostFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected