Remove zod, just use typebox

This commit is contained in:
Dominic Ferrando
2026-07-01 11:06:27 -04:00
parent f5fb64e467
commit e90441bbaa
6 changed files with 26 additions and 30 deletions
+14 -13
View File
@@ -1,4 +1,5 @@
import { z } from "zod";
import { Type } from "@sinclair/typebox";
import type { Static } from "@sinclair/typebox";
export enum Attribute {
Strength = "Strength",
@@ -21,24 +22,24 @@ export enum Gender {
Female = "Female",
}
export const MetricsSchema = z.object({
age: z.number(),
weight: z.number(),
gender: z.enum(Gender),
export const MetricsSchema = Type.Object({
age: Type.Number(),
weight: Type.Number(),
gender: Type.Enum(Gender),
});
export const PlayerSchema = z.object({
name: z.string().optional(),
export const PlayerSchema = Type.Object({
name: Type.Optional(Type.String()),
metrics: MetricsSchema,
});
export const ActivityPerformanceSchema = z.object({
activity: z.enum(Activity),
performance: z.number(),
export const ActivityPerformanceSchema = Type.Object({
activity: Type.Enum(Activity),
performance: Type.Number(),
});
export type StandardUnit = "ms" | "cm" | "kg";
export type Metrics = z.infer<typeof MetricsSchema>;
export type Player = z.infer<typeof PlayerSchema>;
export type ActivityPerformance = z.infer<typeof ActivityPerformanceSchema>;
export type Metrics = Static<typeof MetricsSchema>;
export type Player = Static<typeof PlayerSchema>;
export type ActivityPerformance = Static<typeof ActivityPerformanceSchema>;