Skip to content

Commit 2b024bb

Browse files
authored
[Cleanup] Remove LGraphNode.isValidWidgetLink (#3549)
1 parent 6e5930c commit 2b024bb

File tree

1 file changed

+0
-42
lines changed

1 file changed

+0
-42
lines changed

src/extensions/core/widgetInputs.ts

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,6 @@ import { mergeInputSpec } from '@/utils/nodeDefUtil'
1818
import { applyTextReplacements } from '@/utils/searchAndReplace'
1919
import { isPrimitiveNode } from '@/utils/typeGuardUtil'
2020

21-
const VALID_TYPES = [
22-
'STRING',
23-
'combo',
24-
'number',
25-
'toggle',
26-
'BOOLEAN',
27-
'text',
28-
'string'
29-
]
30-
3121
const replacePropertyName = 'Run widget replace on values'
3222
export class PrimitiveNode extends LGraphNode {
3323
controlValues?: any[]
@@ -352,31 +342,6 @@ export class PrimitiveNode extends LGraphNode {
352342
}
353343
}
354344

355-
isValidWidgetLink(
356-
originSlot: number,
357-
targetNode: LGraphNode,
358-
targetWidget: IWidget
359-
) {
360-
const config2 = getConfig.call(targetNode, targetWidget.name) ?? [
361-
targetWidget.type,
362-
targetWidget.options || {}
363-
]
364-
if (!isConvertibleWidget(targetWidget, config2)) return false
365-
366-
const output = this.outputs[originSlot]
367-
if (
368-
!(
369-
output.widget?.[CONFIG] ??
370-
(output.widget?.[GET_CONFIG] as () => InputSpec)?.()
371-
)
372-
) {
373-
// No widget defined for this primitive yet so allow it
374-
return true
375-
}
376-
377-
return !!mergeIfValid.call(this, output, config2)
378-
}
379-
380345
#isValidConnection(input: INodeInputSlot, forceUpdate?: boolean) {
381346
// Only allow connections where the configs match
382347
const output = this.outputs?.[0]
@@ -445,13 +410,6 @@ function getConfig(this: LGraphNode, widgetName: string) {
445410
)
446411
}
447412

448-
function isConvertibleWidget(widget: IWidget, config: InputSpec): boolean {
449-
return (
450-
// @ts-expect-error InputSpec is not typed correctly
451-
VALID_TYPES.includes(widget.type) || VALID_TYPES.includes(config[0])
452-
)
453-
}
454-
455413
/**
456414
* Convert a widget to an input slot.
457415
* @deprecated Widget to socket conversion is no longer necessary, as they co-exist now.

0 commit comments

Comments
 (0)