fix(types): address CodeRabbit review comments

groupNodeManage.ts:
- Add bounds checking before accessing node indices in link/external loops
- Fix selectedNodeInnerIndex getter with proper runtime guards
- Change storeModification section param to string | symbol, removing casts

asyncDialog.ts:
- Initialize #resolve with no-op function for defensive safety

api.ts:
- Add warning log for unexpected non-array queue prompts
This commit is contained in:
Johnpaul
2026-01-16 03:55:18 +01:00
parent 7321c6e19e
commit c1d763a6fa
3 changed files with 23 additions and 12 deletions

View File

@@ -925,7 +925,10 @@ export class ComfyApi extends EventTarget {
type RawQueuePrompt = V1RawPrompt | CloudRawPrompt
const normalizeQueuePrompt = (prompt: RawQueuePrompt): TaskPrompt => {
if (!Array.isArray(prompt)) return prompt as TaskPrompt
if (!Array.isArray(prompt)) {
console.warn('Unexpected non-array queue prompt:', prompt)
return prompt as TaskPrompt
}
const fourth = prompt[3]
// Cloud shape: 4th is array (outputs), 5th is metadata object
if (Array.isArray(fourth)) {

View File

@@ -6,7 +6,7 @@ type DialogAction<T> = string | { value?: T; text: string }
export class ComfyAsyncDialog<
T = string | null
> extends ComfyDialog<HTMLDialogElement> {
#resolve!: (value: T | null) => void
#resolve: (value: T | null) => void = () => {}
constructor(actions?: Array<DialogAction<T>>) {
super(