23 lines · 1.0 KB · TypeScript
RawDownload
import type { ExecutionEnvironmentPlatformOs, FileManagerRevealKind } from "@t3tools/contracts"; export function revealInFileExplorerLabel(platform: string): string {  const normalized = platform.toLowerCase();  if (normalized.includes("mac")) return "Reveal in Finder";  if (normalized.includes("win")) return "Reveal in File Explorer";  return "Reveal in Files";} /** Same wording keyed by an environment's reported OS rather than a    navigator platform string, for actions that reveal on the server machine. */export function revealInFileExplorerLabelForOs(os: ExecutionEnvironmentPlatformOs): string {  if (os === "darwin") return "Reveal in Finder";  if (os === "windows") return "Reveal in File Explorer";  return "Reveal in Files";} /** Server-selected wording, including Windows File Explorer reached from WSL. */export function revealInFileExplorerLabelForKind(kind: FileManagerRevealKind): string {  if (kind === "finder") return "Reveal in Finder";  if (kind === "file-explorer") return "Reveal in File Explorer";  return "Reveal in Files";}