Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

648 B
Raw Blame
/**
 * Build the client-side filename for a Universe Markdown world-bible export.
 *
 * This mirrors the server's `universeMarkdownFilename` contract so a file
 * saved by the browser has the same safe name as the response attachment.
 * Contract cases live in `universeMarkdownFilename.cases.js` and are shared
 * by the client and server tests.
 */

export const slugifyUniverseName = (name) => String(name ?? '')
  .normalize('NFKD')
  .replace(/[\u0300-\u036f]/g, '')
  .toLowerCase()
  .replace(/[^a-z0-9]+/g, '-')
  .replace(/^-+|-+$/g, '') || 'universe';

export const universeMarkdownFilename = (name) => `${slugifyUniverseName(name)}.md`;