import { type GovlabContext, type Principle, slugify } from "@govlab/context"; export const archIndexOf = function archIndexOf(context: GovlabContext): ReadonlyMap { const index = new Map(); for (const principle of context.arch.all()) { for (const key of [principle.id, principle.name, ...(principle.aliases ?? [])]) { index.set(slugify(key), principle); } } return index; }; export const categoryLabelsOf = function categoryLabelsOf(context: GovlabContext): ReadonlyMap { const labels = new Map(); for (const principle of context.arch.all()) { labels.set(slugify(principle.category), principle.category); } return labels; };