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({
|
const PotencyStatus = z.object({
|
||||||
duration: z.number().int(),
|
duration: z.number().int(),
|
||||||
potency: z.number().int()
|
potency: z.number().int()
|
||||||
});
|
}).strict();
|
||||||
export type PotencyStatus = z.infer<typeof PotencyStatus>;
|
export type PotencyStatus = z.infer<typeof PotencyStatus>;
|
||||||
|
|
||||||
const Effect = z.object({
|
const Effect = z.object({
|
||||||
@ -34,14 +34,14 @@ const Effect = z.object({
|
|||||||
accuracyChange: z.optional(PotencyStatus),
|
accuracyChange: z.optional(PotencyStatus),
|
||||||
speedChange: z.optional(PotencyStatus),
|
speedChange: z.optional(PotencyStatus),
|
||||||
function: z.optional(z.string())
|
function: z.optional(z.string())
|
||||||
});
|
}).strict();
|
||||||
type Effect = z.infer<typeof Effect>;
|
type Effect = z.infer<typeof Effect>;
|
||||||
|
|
||||||
const Skill = z.object({
|
const Skill = z.object({
|
||||||
name: z.string(),
|
name: z.string(),
|
||||||
accuracy: z.optional(z.number().int()),
|
accuracy: z.optional(z.number().int()),
|
||||||
effects: z.array(Effect)
|
effects: z.array(Effect)
|
||||||
});
|
}).strict();
|
||||||
type Skill = z.infer<typeof Skill>;
|
type Skill = z.infer<typeof Skill>;
|
||||||
|
|
||||||
const Character = z.object({
|
const Character = z.object({
|
||||||
@ -52,7 +52,7 @@ const Character = z.object({
|
|||||||
health: z.number().int(),
|
health: z.number().int(),
|
||||||
speed: z.number().int(),
|
speed: z.number().int(),
|
||||||
skills: z.tuple([Skill, Skill, Skill])
|
skills: z.tuple([Skill, Skill, Skill])
|
||||||
});
|
}).strict();
|
||||||
export type Character = z.infer<typeof Character>;
|
export type Character = z.infer<typeof Character>;
|
||||||
|
|
||||||
const CharacterJSON = z.array(Character);
|
const CharacterJSON = z.array(Character);
|
||||||
|
Loading…
Reference in New Issue
Block a user