File size: 474 Bytes
1e92f2d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
import { z } from "zod";
import { defaultItem, itemSchema } from "../shared";
// Schema
export const skillSchema = itemSchema.extend({
name: z.string(),
description: z.string(),
level: z.coerce.number().min(0).max(5).default(1),
keywords: z.array(z.string()).default([]),
});
// Type
export type Skill = z.infer<typeof skillSchema>;
// Defaults
export const defaultSkill: Skill = {
...defaultItem,
name: "",
description: "",
level: 1,
keywords: [],
};
|