chore: ARTEX 初始化
ARTEX — AI 自主渗透测试系统(Go 后端 + Next.js 前端,单二进制内嵌)。 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This commit is contained in:
commit
0ef8561411
287 files changed
+70178
No files matched your search
@@ -0,0 +1,42 @@
|
||||
import { type ClassValue, clsx } from "clsx";
|
||||
import { twMerge } from "tailwind-merge";
|
||||
|
||||
export function cn(...inputs: ClassValue[]) {
|
||||
return twMerge(clsx(inputs));
|
||||
}
|
||||
|
||||
export const getInitials = (str: string): string => {
|
||||
if (typeof str !== "string" || !str.trim()) return "?";
|
||||
|
||||
return (
|
||||
str
|
||||
.trim()
|
||||
.split(/\s+/)
|
||||
.filter(Boolean)
|
||||
.map((word) => word[0])
|
||||
.join("")
|
||||
.toUpperCase() || "?"
|
||||
);
|
||||
};
|
||||
|
||||
export function formatCurrency(
|
||||
amount: number,
|
||||
opts?: {
|
||||
currency?: string;
|
||||
locale?: string;
|
||||
minimumFractionDigits?: number;
|
||||
maximumFractionDigits?: number;
|
||||
noDecimals?: boolean;
|
||||
},
|
||||
) {
|
||||
const { currency = "USD", locale = "en-US", minimumFractionDigits, maximumFractionDigits, noDecimals } = opts ?? {};
|
||||
|
||||
const formatOptions: Intl.NumberFormatOptions = {
|
||||
style: "currency",
|
||||
currency,
|
||||
minimumFractionDigits: noDecimals ? 0 : minimumFractionDigits,
|
||||
maximumFractionDigits: noDecimals ? 0 : maximumFractionDigits,
|
||||
};
|
||||
|
||||
return new Intl.NumberFormat(locale, formatOptions).format(amount);
|
||||
}
|
||||
Reference in new issue
Block a user