Skip to content

Commit dd542ec

Browse files
committed
fix(ui): type the per-rule intersection so @object-ui/core builds
Claude-Session: https://claude.ai/code/session_015Kzn5VKHAGKe251waHoUqj Co-authored-by: Claude <noreply@anthropic.com>
1 parent 794c315 commit dd542ec

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎ui/packages/core/src/validation/validators/state-machine-next-values.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,14 @@ export function stateMachineNextValues(
8989
if (currentValue === undefined || currentValue === null) return null;
9090
const from = String(currentValue);
9191

92-
let reachable: Set<string> | null = null;
92+
const perRule: Set<string>[] = [];
9393
for (const rule of rules) {
9494
if (!isBlockingUpdateMachine(rule, fieldName)) continue;
9595
const allowed = rule.transitions[from];
9696
// An undeclared from-state is not policed by this rule.
9797
if (!Array.isArray(allowed)) continue;
98-
const next = new Set<string>([from, ...allowed.map((s) => String(s))]);
99-
reachable = reachable === null ? next : new Set([...reachable].filter((v) => next.has(v)));
98+
perRule.push(new Set<string>([from, ...allowed.map((s) => String(s))]));
10099
}
101-
return reachable;
100+
if (perRule.length === 0) return null;
101+
return perRule.reduce((acc, next) => new Set([...acc].filter((v) => next.has(v))));
102102
}

0 commit comments

Comments
 (0)