Initial commit — ClawChat v1.0.0
This commit is contained in:
15
src/lib/utils.ts
Normal file
15
src/lib/utils.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { clsx, type ClassValue } from "clsx";
|
||||
import { twMerge } from "tailwind-merge";
|
||||
|
||||
export function cn(...inputs: ClassValue[]) {
|
||||
return twMerge(clsx(inputs));
|
||||
}
|
||||
|
||||
let counter = 0;
|
||||
export function genId(prefix = 'req') {
|
||||
return `${prefix}-${++counter}-${Date.now()}`;
|
||||
}
|
||||
|
||||
export function genIdempotencyKey() {
|
||||
return `${Date.now()}-${Math.random().toString(36).slice(2, 10)}`;
|
||||
}
|
||||
Reference in New Issue
Block a user