SPB Git
2.3 KB · 18 lines typescript
1import { clsx, type ClassValue } from "clsx";2import { twMerge } from "tailwind-merge";3export const cn = (...i: ClassValue[]) => twMerge(clsx(i));4export const fmtDate = (d: Date | string | null | undefined) => (d ? new Intl.DateTimeFormat("en-CA", { dateStyle: "medium", timeZone: "America/Toronto" }).format(new Date(d)) : "—");5export const fmtDateTime = (d: Date | string | null | undefined) => (d ? new Intl.DateTimeFormat("en-CA", { dateStyle: "medium", timeStyle: "short", timeZone: "America/Toronto" }).format(new Date(d)) : "—");6export const LABELS: Record<string, string> = {7  macos: "macOS", windows: "Windows", linux: "Linux", ios: "iOS", android: "Android", web: "Web", any: "Any",8  cloud: "Cloud", "self-hosted": "Self-hosted", local: "Local", desktop: "Desktop", mobile: "Mobile", cli: "CLI", api: "API", sdk: "SDK", library: "Library", "ide-extension": "IDE extension", "browser-extension": "Browser extension", "mcp-server": "MCP server",9  "open-source": "Open source", proprietary: "Proprietary", "source-available": "Source-available", mixed: "Mixed",10  free: "Free", freemium: "Freemium", paid: "Paid", enterprise: "Enterprise", "usage-based": "Usage-based", academic: "Academic", unknown: "Unknown",11  active: "Active", maintenance: "Maintenance", deprecated: "Deprecated", discontinued: "Discontinued", renamed: "Renamed",12  deep: "In-depth", standard: "Standard", saas: "SaaS", "on-premises": "On-premises", hybrid: "Hybrid", embedded: "Embedded", "managed-cloud": "Managed cloud",13  application: "Application", framework: "Framework", "api-service": "API service", platform: "Platform", "cli-tool": "CLI tool", language: "Language", database: "Database", model: "Model", "data-service": "Data service", extension: "Extension", specification: "Specification", service: "Service",14  high: "High", medium: "Medium", low: "Low", ok: "Verified", redirected: "Redirected", broken: "Broken", unchecked: "Unchecked",15  official_site: "Official site", official_docs: "Official documentation", repository: "Repository", release_notes: "Release notes", pricing_page: "Pricing page", policy_page: "Policy page", license_page: "License", package_registry: "Package registry", academic_paper: "Paper", third_party_directory: "Directory", news: "News", other: "Other",16};17export const label = (v: string) => LABELS[v] ?? v.replace(/-/g, " ").replace(/^\w/, (c) => c.toUpperCase());18
Files · d0878ed8ec6f375df09d3e415bf35d941ff62d79
Menu

Theme