MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / inject

Function inject

apps/start/src/hooks/use-project-document-title.ts:5–9  ·  view source on GitHub ↗
(title: string, projectName: string)

Source from the content-addressed store, hash-verified

3const BASE_SUFFIX = ' | OpenPanel.dev';
4
5function inject(title: string, projectName: string): string {
6 if (!title.endsWith(BASE_SUFFIX)) return title;
7 if (title.includes(` | ${projectName}${BASE_SUFFIX}`)) return title;
8 return title.replace(BASE_SUFFIX, ` | ${projectName}${BASE_SUFFIX}`);
9}
10
11// Browser tab titles are set by each route's `head()` (server + client).
12// Rather than threading project name through every route's loader/head,

Callers 1

applyFunction · 0.85

Calls 1

replaceMethod · 0.80

Tested by

no test coverage detected