UNPKG

syllabusobject

Version:

A deterministic builder for static syllabus structures with filename-safe output.

17 lines (13 loc) 359 B
export function createChapter({ id, name, description = "", slug, existingChapters = [] }) { if (!slug) throw new Error(`Missing slug for chapter "${name}"`); const sortOrder = existingChapters.length + 1; return { id, name, description, slug, // REQUIRED sortOrder, image: "pivot/box.webp", link: "/", }; }