34 lines · 1.1 KB · TypeScript
RawDownload
const NIGHTLY_SERVER_VERSION_PATTERN = /-nightly\.\d{8}\.\d+$/; export function formatAppDisplayName(input: {  readonly baseName: string;  readonly stageLabel: string;}): string {  return `${input.baseName} (${input.stageLabel})`;} export function resolveServerBackedAppStageLabel(input: {  readonly primaryServerVersion: string | null | undefined;  readonly fallbackStageLabel: string;}): string {  return input.primaryServerVersion &&    NIGHTLY_SERVER_VERSION_PATTERN.test(input.primaryServerVersion)    ? "Nightly"    : input.fallbackStageLabel;} export function resolveServerBackedAppDisplayName(input: {  readonly baseName: string;  readonly fallbackDisplayName: string;  readonly fallbackStageLabel: string;  readonly primaryServerVersion: string | null | undefined;}): string {  const stageLabel = resolveServerBackedAppStageLabel({    primaryServerVersion: input.primaryServerVersion,    fallbackStageLabel: input.fallbackStageLabel,  });   return stageLabel === input.fallbackStageLabel    ? input.fallbackDisplayName    : formatAppDisplayName({ baseName: input.baseName, stageLabel });}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t