throw error when receiving unknown keys
This commit is contained in:
parent
678318df88
commit
0a04fd2e90
@ -17,7 +17,7 @@ type TargetEnum = z.infer<typeof TargetEnum>;
|
||||
const PotencyStatus = z.object({
|
||||
duration: z.number().int(),
|
||||
potency: z.number().int()
|
||||
});
|
||||
}).strict();
|
||||
export type PotencyStatus = z.infer<typeof PotencyStatus>;
|
||||
|
||||
const Effect = z.object({
|
||||
@ -34,14 +34,14 @@ const Effect = z.object({
|
||||
accuracyChange: z.optional(PotencyStatus),
|
||||
speedChange: z.optional(PotencyStatus),
|
||||
function: z.optional(z.string())
|
||||
});
|
||||
}).strict();
|
||||
type Effect = z.infer<typeof Effect>;
|
||||
|
||||
const Skill = z.object({
|
||||
name: z.string(),
|
||||
accuracy: z.optional(z.number().int()),
|
||||
effects: z.array(Effect)
|
||||
});
|
||||
}).strict();
|
||||
type Skill = z.infer<typeof Skill>;
|
||||
|
||||
const Character = z.object({
|
||||
@ -52,7 +52,7 @@ const Character = z.object({
|
||||
health: z.number().int(),
|
||||
speed: z.number().int(),
|
||||
skills: z.tuple([Skill, Skill, Skill])
|
||||
});
|
||||
}).strict();
|
||||
export type Character = z.infer<typeof Character>;
|
||||
|
||||
const CharacterJSON = z.array(Character);
|
||||
|
Loading…
Reference in New Issue
Block a user