()
| 55 | } |
| 56 | |
| 57 | async function getThemeHelpers() { |
| 58 | if (!themeHelpersPromise) { |
| 59 | const piPackageRoot = await resolvePiPackageRootFromImport().catch(() => findPiPackageRoot()) |
| 60 | const themeModulePath = path.join(piPackageRoot, 'dist', 'modes/interactive/theme/theme.js') |
| 61 | themeHelpersPromise = import(pathToFileURL(themeModulePath).href) as Promise<ThemeHelpersModule> |
| 62 | } |
| 63 | return themeHelpersPromise |
| 64 | } |
| 65 | |
| 66 | function asDiagnostic(diagnostic: unknown): PiThemeState['diagnostics'][number] | null { |
| 67 | if (!diagnostic || typeof diagnostic !== 'object') return null |
no test coverage detected