Compare commits

...

1 Commits

Author SHA1 Message Date
Glary-Bot
195b957841 fix: remove dead code paths from getSlotKey
Simplify getSlotKey to a single 3-arg signature by removing:
- Object-form overload (0 of 21 call sites use it)
- Runtime undefined guard (unreachable due to TS typing)

Both paths had 0% coverage across the entire e2e suite.
The @TODO and an in-progress feature branch confirm this
function is transitional code.
2026-04-20 02:32:59 +00:00

View File

@@ -6,35 +6,14 @@
* @TODO Replace this concatenated string with root cause fix
*/
interface SlotIdentifier {
nodeId: string
index: number
isInput: boolean
}
/**
* Generate a unique key for a slot
* Format: "{nodeId}-{in|out}-{index}"
*/
export function getSlotKey(identifier: SlotIdentifier): string
export function getSlotKey(
nodeId: string,
index: number,
isInput: boolean
): string
export function getSlotKey(
nodeIdOrIdentifier: string | SlotIdentifier,
index?: number,
isInput?: boolean
): string {
if (typeof nodeIdOrIdentifier === 'object') {
const { nodeId, index, isInput } = nodeIdOrIdentifier
return `${nodeId}-${isInput ? 'in' : 'out'}-${index}`
}
if (index === undefined || isInput === undefined) {
throw new Error('Missing required parameters for slot key generation')
}
return `${nodeIdOrIdentifier}-${isInput ? 'in' : 'out'}-${index}`
return `${nodeId}-${isInput ? 'in' : 'out'}-${index}`
}