mirror of
https://github.com/ckaczor/Blog.git
synced 2026-01-13 17:22:16 -05:00
Reformatting
This commit is contained in:
@@ -1,13 +1,15 @@
|
||||
import { z } from "zod";
|
||||
import { fromZodError } from 'zod-validation-error';
|
||||
import { fromZodError } from "zod-validation-error";
|
||||
|
||||
export default function(data) {
|
||||
export default function (data) {
|
||||
// Draft content, validate `draft` front matter
|
||||
let result = z.object({
|
||||
draft: z.boolean().or(z.undefined()),
|
||||
}).safeParse(data);
|
||||
let result = z
|
||||
.object({
|
||||
draft: z.boolean().or(z.undefined())
|
||||
})
|
||||
.safeParse(data);
|
||||
|
||||
if(result.error) {
|
||||
if (result.error) {
|
||||
throw fromZodError(result.error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,4 +8,4 @@ export default {
|
||||
email: "chris@kaczor.us",
|
||||
url: "https://chriskaczor.com/about/"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user