From cbf59a2672ef66fc20654f1d746022f838b76271 Mon Sep 17 00:00:00 2001 From: Roman Date: Fri, 3 Apr 2026 00:06:20 +0100 Subject: [PATCH] feat: add `getReplacementDescription` --- src/util.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/util.ts b/src/util.ts index 172c9959..1ccc0f44 100644 --- a/src/util.ts +++ b/src/util.ts @@ -1,4 +1,4 @@ -import type {KnownUrl} from './types.js'; +import type {KnownUrl, ModuleReplacement} from './types.js'; export function resolveDocUrl(url?: KnownUrl): string | null { if (!url) return null; @@ -15,3 +15,10 @@ export function resolveDocUrl(url?: KnownUrl): string | null { return null; } } + +export function getReplacementDescription( + replacement: ModuleReplacement +): string | undefined { + if (!('description' in replacement)) return undefined; + return replacement.description; +}