n4s
Version:
typed schema validation version of enforce
17 lines (13 loc) • 380 B
text/typescript
import type { Predicate } from './chainExecutor';
const lazyRegistry: Record<string, (...args: any[]) => Predicate> = {};
export function registerLazyRule(
name: string,
builder: (...args: any[]) => Predicate,
) {
lazyRegistry[name] = builder;
}
export function getLazyRule(
name: string,
): ((...args: any[]) => Predicate) | undefined {
return lazyRegistry[name];
}