(electronVersion: string | null | undefined, bundledVersion?: string)
| 6 | } from '@openchatlab/node-runtime/src/data-dir-compat' |
| 7 | |
| 8 | export function resolveDesktopAppVersion(electronVersion: string | null | undefined, bundledVersion?: string): string { |
| 9 | const normalizedElectronVersion = normalizeVersion(electronVersion) |
| 10 | if (normalizedElectronVersion && normalizedElectronVersion !== '0.0.0') return normalizedElectronVersion |
| 11 | |
| 12 | const normalizedBundledVersion = normalizeVersion(bundledVersion) |
| 13 | if (normalizedBundledVersion) return normalizedBundledVersion |
| 14 | |
| 15 | return normalizedElectronVersion || '0.0.0' |
| 16 | } |
| 17 | |
| 18 | export function getDesktopAppVersion(electronVersion: string | null | undefined): string { |
| 19 | return resolveDesktopAppVersion(electronVersion, typeof __APP_VERSION__ !== 'undefined' ? __APP_VERSION__ : undefined) |
no test coverage detected