Skip to content

Commit aee23ea

Browse files
committed
fix types
1 parent 15be26b commit aee23ea

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

src/project/types/book/book-config.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -257,13 +257,11 @@ export async function bookProjectConfig(
257257
const footerFiles: string[] = [];
258258
const pageFooter = resolvePageFooter(config);
259259
const addFooterItems = (region?: PageFooterRegion) => {
260-
if (!region) return;
260+
if (!region || typeof region === "string") return;
261261
for (const item of region) {
262-
if (typeof item !== "string") {
263-
const navItem = Zod.NavigationItemObject.parse(item);
264-
if (navItem.href && !isAbsoluteRef(navItem.href)) {
265-
footerFiles.push(navItem.href);
266-
}
262+
const navItem = Zod.NavigationItemObject.parse(item);
263+
if (navItem.href && !isAbsoluteRef(navItem.href)) {
264+
footerFiles.push(navItem.href);
267265
}
268266
}
269267
};

src/resources/types/zod/handwritten-schema-types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,10 @@ export const Base_ZodNavigationItemObject = z.object({
109109
}).strict().partial();
110110

111111
type NavigationItemObject = z.infer<typeof Base_ZodNavigationItemObject> & {
112-
menu: NavigationItem[];
112+
menu?: NavigationItem[];
113113
};
114114

115115
export const ZodNavigationItemObject: z.ZodType<NavigationItemObject> =
116116
Base_ZodNavigationItemObject.extend({
117117
menu: z.array(z.lazy(() => ZodNavigationItem)),
118-
});
118+
}).strict().partial();

0 commit comments

Comments
 (0)