Files
TechRadarAJR/src/lib/utils.ts
2024-07-01 11:52:30 +02:00

15 lines
371 B
TypeScript

import { type ClassValue, clsx } from "clsx";
import config from "../../next.config.js";
export function cn(...inputs: ClassValue[]) {
return clsx(inputs);
}
export function assetUrl(path: string) {
if (/^https?:/.test(path)) return path;
if (!config.basePath) return path;
if (!path.startsWith("/")) path = "/" + path;
return `${config.basePath}${path}`;
}