Files
tinyauth/frontend/src/lib/utils.ts
2025-05-09 16:49:54 +03:00

19 lines
392 B
TypeScript

import { clsx, type ClassValue } from "clsx"
import { twMerge } from "tailwind-merge"
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}
export const isValidUrl = (url: string) => {
try {
new URL(url)
return true
} catch (e) {
return false
}
}
export const capitalize = (str: string) => {
return str.charAt(0).toUpperCase() + str.slice(1);
}