mirror of
https://github.com/khairul169/code-share.git
synced 2025-04-29 00:59:37 +07:00
16 lines
430 B
TypeScript
16 lines
430 B
TypeScript
import { type ClassValue, clsx } from "clsx";
|
|
import { twMerge } from "tailwind-merge";
|
|
import { BASE_URL } from "./consts";
|
|
|
|
export function cn(...inputs: ClassValue[]) {
|
|
return twMerge(clsx(inputs));
|
|
}
|
|
|
|
export function getFileExt(filename: string) {
|
|
return filename.substring(filename.lastIndexOf(".") + 1);
|
|
}
|
|
|
|
export function getUrl(...path: string[]) {
|
|
return BASE_URL + ("/" + path.join("/")).replace(/\/\/+/g, "/");
|
|
}
|