Files
OmniRoute/open-sse/services/combo/comboData.ts
Diego Rodrigues de Sa e Souza 798fce727c refactor(combo): god-file split part 2 — shadow + sorters + structure (QG v2 Fase 9 T5 D4-D6) (#4175)
Integrated into release/v3.8.29 — combo.ts god-file split part 2 (QG v2 Fase 9 T5 D4-D6): shadow routing, target sorters, and combo structure resolution extracted byte-identically to combo/{shadowRouting,targetSorters,comboStructure,comboData}.ts; combo.ts 4740->3819, public surface re-exported (callers unchanged). Validated on the rebased+merged tree: typecheck:core, file-size, test-discovery green; 356/356 full combo suite + 51/51 smoke pass. Resynced with current release (baseline union: combo-split entries + #4176 free-models entry; combo.ts=3819, rateLimitManager=1035).
2026-06-18 12:52:06 -03:00

25 lines
948 B
TypeScript

/**
* Shared combo data-normalization helpers extracted from combo.ts.
*
* Tiny side-effect-free guards/normalizers that several combo submodules depend
* on (shadow routing, combo structure resolution) plus combo.ts itself. Moving
* them to this leaf module out of the combo.ts god-file (Quality Gate v2 /
* Fase 9) lets the submodules import them without reaching back into the barrel
* (no cycles). Logic unchanged; combo.ts imports them back for compatibility.
*/
import type { ResolvedComboTarget } from "./types.ts";
export function isRecord(value: unknown): value is Record<string, unknown> {
return !!value && typeof value === "object" && !Array.isArray(value);
}
export function dedupeTargetsByExecutionKey(targets: ResolvedComboTarget[]) {
const seen = new Set<string>();
return targets.filter((target) => {
if (seen.has(target.executionKey)) return false;
seen.add(target.executionKey);
return true;
});
}