MCPcopy Create free account
hub / github.com/bytebase/bytebase / buildDocumentTitle

Function buildDocumentTitle

frontend/src/utils/document-title.ts:4–14  ·  view source on GitHub ↗
(...segments: string[])

Source from the content-addressed store, hash-verified

2export const DOCUMENT_TITLE_SUFFIX = "Bytebase";
3
4export function buildDocumentTitle(...segments: string[]): string {
5 const filtered = segments.filter((s) => s.length > 0);
6 if (filtered.length === 0) {
7 return DOCUMENT_TITLE_SUFFIX;
8 }
9 return (
10 filtered.join(DOCUMENT_TITLE_SEPARATOR) +
11 DOCUMENT_TITLE_SEPARATOR +
12 DOCUMENT_TITLE_SUFFIX
13 );
14}
15
16export function setDocumentTitle(...segments: string[]): void {
17 document.title = buildDocumentTitle(...segments);

Callers 1

setDocumentTitleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected