core/registries/anatomy.tree.registry.ts
core/registries/anatomy.tree.registry.ts is a file in Bane's Lab Site. 14 lines of code and 3 definitions.
import { ANATOMY_TREE_DECLARATIONS } from "#core/generated/anatomy.trees.generated";
import type { AnatomyTreeDeclaration } from "#types/anatomy.types";
import { unpublishedTree } from "#configuration/strings/report.strings";
export { ANATOMY_TREE_DECLARATIONS } from "#core/generated/anatomy.trees.generated";
export const treeDeclarationOf = function treeDeclarationOf(tab: string): AnatomyTreeDeclaration | undefined {
return ANATOMY_TREE_DECLARATIONS.find((declaration) => declaration.tab === tab);
};
export const repositoryOf = function repositoryOf(tab: string): string {
const repository = treeDeclarationOf(tab)?.repository ?? null;
if (repository === null) {
throw new Error(unpublishedTree(tab));
}
return repository;
};