From ca67902e372173167bc9d468bfd0577c90214e4f Mon Sep 17 00:00:00 2001 From: flexykrn Date: Wed, 17 Jun 2026 17:54:34 +0530 Subject: [PATCH] Docusaurus migration - website-src-lib Part 70 of the Docusaurus migration split. --- website/src/lib/utils.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 website/src/lib/utils.ts diff --git a/website/src/lib/utils.ts b/website/src/lib/utils.ts new file mode 100644 index 00000000..109d7315 --- /dev/null +++ b/website/src/lib/utils.ts @@ -0,0 +1,15 @@ +import { type ClassValue, clsx } from 'clsx'; +import { twMerge } from 'tailwind-merge'; + +export function cn(...inputs: ClassValue[]) { + return twMerge(clsx(inputs)); +} + +export function formatNumber(num: number): string { + return new Intl.NumberFormat('en-US').format(num); +} + +export function truncate(str: string, length: number): string { + if (str.length <= length) return str; + return str.slice(0, length) + '...'; +}