Skip to content

AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.

437 B
Raw Blame
type DevelopmentProfile = "" | "local" | "demo";

const existingEnvironmentPrefix = /^\[(?:DEV|DEMO|LOCAL|LOCAL DEMO)\]\s*/;

export const withEnvironmentTitlePrefix = (
  title: string,
  options: { development: boolean; profile: DevelopmentProfile },
) => {
  if (!options.development) return title;
  const label = options.profile === "demo" ? "DEMO" : "DEV";
  return `[${label}] ${title.replace(existingEnvironmentPrefix, "")}`;
};