src/doc-meta.ts
16 lines and 2 functions in DrDustinEdwards/capsid, at commit daa875b on 2026-10-24. This file on GitHub.
Functions
| Function | Lines | Complexity | Covered | CRAP | Mutation |
|---|---|---|---|---|---|
| validateDocType | 11 to 14 | 2 | 100% | OkCRAP 2 | No data: mutation testing has not run on this repo yet |
| validateDocStatus | 16 to 19 | 2 | 100% | OkCRAP 2 | No data: mutation testing has not run on this repo yet |
Imports
It imports no other module of this repo. Imported by src/tools/docs-write.ts.
Source
export const DOC_TYPES = new Set([
"core", "concept", "semantic", "note", "decision", "spec", "task", "protocol",
"post", "episodic", "procedural", "source", "prompt", "reference",
]);
// Editorial state only. Lint visibility is the archive/ prefix, not this column.
export const DOC_STATUSES = new Set([
"draft", "ready", "active", "published", "superseded", "closed",
]);
export function validateDocType(type: string): string | null {
if (DOC_TYPES.has(type)) return null;
return `unknown type '${type}'; valid types: ${[...DOC_TYPES].join(", ")}. Session logs and handoffs are 'episodic'.`;
}
export function validateDocStatus(status: string): string | null {
if (DOC_STATUSES.has(status)) return null;
return `unknown status '${status}'; valid statuses: ${[...DOC_STATUSES].join(", ")}. Status does not control lint visibility; only the archive/ path prefix does.`;
}