( bundledThemeEntries: ReturnType<typeof getBundledThemes>, themesResult: DiscoveredThemesResult, )
| 107 | } |
| 108 | |
| 109 | function 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 | |
| 126 | function loadBundledThemes(loadThemeFromPath: (themePath: string) => unknown): LoadedBundledThemes { |
| 127 | const entries: LoadedBundledThemes['entries'] = [] |
no outgoing calls
no test coverage detected