startup-notice.ts 450 B

12345678910111213
  1. import type { McodeUpdatePlan } from './application.js';
  2. export interface McodeStartupUpdateNotice {
  3. readonly latestVersion: string;
  4. }
  5. export function resolveMcodeStartupUpdateNotice(
  6. plan: McodeUpdatePlan,
  7. ): McodeStartupUpdateNotice | undefined {
  8. if (plan.kind !== 'available' && plan.kind !== 'package-manager') return undefined;
  9. const latestVersion = plan.latestVersion.trim();
  10. return latestVersion ? { latestVersion } : undefined;
  11. }