feat(base-formula): add function registry register helper

This commit is contained in:
Philipinho
2026-04-23 23:56:48 +01:00
parent ded855e44e
commit 1b30de32b5
2 changed files with 8 additions and 1 deletions
@@ -12,3 +12,10 @@ export type FormulaFn = {
};
export const registry: Map<string, FormulaFn> = new Map();
export function register(fn: FormulaFn): void {
if (registry.has(fn.name)) {
throw new Error(`Duplicate formula function: ${fn.name}`);
}
registry.set(fn.name, fn);
}