mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 15:02:21 -04:00
12 lines
325 B
TypeScript
12 lines
325 B
TypeScript
export function mergeTooltipAndShortcut(
|
|
tooltip: string | undefined,
|
|
shortcutLabel: string | undefined
|
|
): string | undefined {
|
|
return tooltip
|
|
? shortcutLabel
|
|
? `${tooltip} (${shortcutLabel})`
|
|
: tooltip
|
|
: shortcutLabel
|
|
? `(${shortcutLabel})`
|
|
: undefined;
|
|
}
|