mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-28 04:03:05 +00:00
17 lines
565 B
TypeScript
17 lines
565 B
TypeScript
interface HighlightLikeToken {
|
|
text: string;
|
|
}
|
|
|
|
// Preserve row height when a gutter or diff cell is intentionally blank.
|
|
export function formatDiffGutterText(lineNumber: number | null): string {
|
|
return lineNumber == null ? " " : String(lineNumber);
|
|
}
|
|
|
|
export function formatDiffContentText(content: string | null | undefined): string {
|
|
return content && content.length > 0 ? content : " ";
|
|
}
|
|
|
|
export function hasVisibleDiffTokens(tokens: HighlightLikeToken[] | null | undefined): boolean {
|
|
return Boolean(tokens?.some((token) => token.text.length > 0));
|
|
}
|