Files
laravel-shopping-cart/resources/js/lib/utils.ts
T
2026-04-09 16:06:44 -06:00

13 lines
379 B
TypeScript

import type { InertiaLinkProps } from '@inertiajs/vue3';
import { clsx } from 'clsx';
import type { ClassValue } from 'clsx';
import { twMerge } from 'tailwind-merge';
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
export function toUrl(href: NonNullable<InertiaLinkProps['href']>) {
return typeof href === 'string' ? href : href?.url;
}