调整目录

This commit is contained in:
mlogclub
2026-04-24 12:01:30 +08:00
parent 7889ecb0d2
commit a9275c2d4a
209 changed files with 0 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
export function getEnumLabel<T extends string | number>(
enumLabels: Record<T, string>,
value: T
): string {
return enumLabels[value] || String(value)
}
export function getEnumOptions<T extends string | number>(
enumLabels: Record<T, string>
): Array<{ value: T; label: string }> {
return Object.entries(enumLabels).map(([value, label]) => ({
value: value as T,
label: label as string,
}))
}