From 9f0d43fe099a95ab1516ae951dcb60a89e76a5a5 Mon Sep 17 00:00:00 2001
From: 简律纯 <i@jyunko.cn>
Date: Fri, 3 Nov 2023 21:13:33 +0800
Subject: chore: delete useless codes

---
 .../pages/TRPG-home/DocsBenchmarkStat.tsx          | 53 ----------------------
 1 file changed, 53 deletions(-)
 delete mode 100644 docs/components/pages/TRPG-home/DocsBenchmarkStat.tsx

(limited to 'docs/components/pages/TRPG-home/DocsBenchmarkStat.tsx')

diff --git a/docs/components/pages/TRPG-home/DocsBenchmarkStat.tsx b/docs/components/pages/TRPG-home/DocsBenchmarkStat.tsx
deleted file mode 100644
index 5b8dcf6..0000000
--- a/docs/components/pages/TRPG-home/DocsBenchmarkStat.tsx
+++ /dev/null
@@ -1,53 +0,0 @@
-import benchmarkData from "./benchmark-data/data.json";
-
-type StatFunc = (data: typeof benchmarkData) => string;
-
-/**
- * Replace with satisfies keyword when TS 4.9 drops
- */
-const satisfies =
-  <T,>() =>
-  <U extends T>(t: U) =>
-    t;
-
-const formatToSeconds = (seconds: number) => `${seconds.toFixed(1)}s`;
-const formatPercentage = (percentage: number) => `${percentage.toFixed(1)}x`;
-
-const stats = satisfies<Record<string, StatFunc>>()({
-  "next12-cold-1000": (data) => formatToSeconds(data.cold[1000].next12),
-  "turbopack-cold-1000": (data) => formatToSeconds(data.cold[1000].next13),
-  "turbopack-cold-vs-next12": (data) =>
-    formatPercentage(data.cold[1000].next12 / data.cold[1000].next13),
-  "turbopack-cold-vs-next12-30000": (data) =>
-    formatPercentage(data.cold[30000].next12 / data.cold[30000].next13),
-  "turbopack-update-vs-next12": (data) =>
-    formatPercentage(
-      data.file_change[1000].next12 / data.file_change[1000].next13
-    ),
-  "turbopack-update-vs-next12-30000": (data) =>
-    formatPercentage(
-      data.file_change[30000].next12 / data.file_change[30000].next13
-    ),
-  "vite-cold-1000": (data) => formatToSeconds(data.cold[1000].vite),
-  "turbopack-cold-vs-vite": (data) =>
-    formatPercentage(data.cold[1000].vite / data.cold[1000].next13),
-  "turbopack-cold-vs-vite-30000": (data) =>
-    formatPercentage(data.cold[30000].vite / data.cold[30000].next13),
-  "turbopack-update-vs-vite": (data) =>
-    formatPercentage(
-      data.file_change[1000].vite / data.file_change[1000].next13
-    ),
-  "turbopack-update-vs-vite-30000": (data) =>
-    formatPercentage(
-      data.file_change[30000].vite / data.file_change[30000].next13
-    ),
-});
-
-type Stat = keyof typeof stats;
-
-export function DocsBenchmarkStat(props: { stat: Stat }) {
-  if (!stats[props.stat]) {
-    throw new Error(`Invalid stat: ${props.stat}`);
-  }
-  return stats[props.stat](benchmarkData);
-}
-- 
cgit v1.2.3-70-g09d2

