Remove zod, just use typebox
This commit is contained in:
@@ -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>;
|
||||
|
||||
Reference in New Issue
Block a user