Const
Zod schema for parsing JSON file path input to object. Use .optional() for optional fields.
.optional()
const schema = z.object({ config: zJsonFile });schema.parse({ config: "./config.json" }); // { config: { key: "value" } } Copy
const schema = z.object({ config: zJsonFile });schema.parse({ config: "./config.json" }); // { config: { key: "value" } }
Zod schema for parsing JSON file path input to object. Use
.optional()for optional fields.