Skip to content

Instantly share code, notes, and snippets.

@omer-os
Last active March 16, 2026 02:58
Show Gist options
  • Select an option

  • Save omer-os/85f9091beddf5219001ae4040815b140 to your computer and use it in GitHub Desktop.

Select an option

Save omer-os/85f9091beddf5219001ae4040815b140 to your computer and use it in GitHub Desktop.
svelte-shadcn utils file
import { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export type WithoutChild<T> = T extends { child?: any } ? Omit<T, "child"> : T;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export type WithoutChildren<T> = T extends { children?: any } ? Omit<T, "children"> : T;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment