markpage
Version:
Build and manage markdown-based content with distributed navigation - framework agnostic content management system
12 lines (11 loc) • 623 B
JavaScript
function validateDocItem(item) {
return typeof item === "object" && item !== null && typeof item.name === "string" && item.name.length > 0 && (item.type === "section" || item.type === "page") && typeof item.label === "string" && item.label.length > 0 && (item.collapsed === void 0 || typeof item.collapsed === "boolean") && (item.url === void 0 || typeof item.url === "string");
}
function validateIndexFile(data) {
return typeof data === "object" && data !== null && Array.isArray(data.items) && data.items.every(validateDocItem);
}
export {
validateDocItem,
validateIndexFile
};
//# sourceMappingURL=types.js.map